@imaentity/selfjs 1.3.7 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/self.js +16 -3
package/package.json
CHANGED
package/self.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @name SelfJS
|
|
3
3
|
* @description Breaking Discord's TOS to bot user accounts.
|
|
4
4
|
* @author Эмберс
|
|
5
|
-
* @version 1.3.
|
|
5
|
+
* @version 1.3.9
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const https = require("https");
|
|
@@ -255,7 +255,7 @@ module.exports = {
|
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
uploadFile(channelID, fileName, msgContent = "", messageID = null) {
|
|
258
|
+
uploadFile(channelID, fileName, isSpoiled = false, msgContent = "", messageID = null) {
|
|
259
259
|
const fileData = fs.readFileSync(fileName);
|
|
260
260
|
|
|
261
261
|
if(fileData.length >= 26214400) return null;
|
|
@@ -619,8 +619,21 @@ module.exports = {
|
|
|
619
619
|
}
|
|
620
620
|
|
|
621
621
|
leaveChannel(channelID) {
|
|
622
|
+
const options = {
|
|
623
|
+
...module.exports.APIBaseOpt,
|
|
624
|
+
method: "DELETE",
|
|
625
|
+
path: `/api/v10/channels/${channelID}`,
|
|
626
|
+
headers: {
|
|
627
|
+
"Authorization": this.token
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
|
|
622
631
|
return new Promise(function(resolve) {
|
|
623
|
-
|
|
632
|
+
const req = https.request(options, function(res) {
|
|
633
|
+
res.on("end", resolve);
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
req.end();
|
|
624
637
|
}.bind(this));
|
|
625
638
|
}
|
|
626
639
|
|