@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/self.js +16 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imaentity/selfjs",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
4
4
  "description": "Breaking Discord's TOS to bot user accounts.",
5
5
  "main": "self.js",
6
6
  "repository": {
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.7
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
- this.removeFromChannel(channelID, this.userID).then(resolve);
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