@imaentity/selfjs 1.3.6 → 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 +5 -2
- package/self.js +16 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imaentity/selfjs",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "Breaking Discord's TOS to bot user accounts.",
|
|
5
5
|
"main": "self.js",
|
|
6
6
|
"repository": {
|
|
@@ -17,5 +17,8 @@
|
|
|
17
17
|
"bugs": {
|
|
18
18
|
"url": "https://github.com/ImaEntity/SelfJS/issues"
|
|
19
19
|
},
|
|
20
|
-
"homepage": "https://github.com/ImaEntity/SelfJS#readme"
|
|
20
|
+
"homepage": "https://github.com/ImaEntity/SelfJS#readme",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"ws": "^7.5.4"
|
|
23
|
+
}
|
|
21
24
|
}
|
package/self.js
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
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");
|
|
9
9
|
const ws = require("ws");
|
|
10
10
|
const fs = require("fs");
|
|
11
|
-
const crypto = require("crypto");
|
|
12
|
-
const dgram = require("dgram");
|
|
13
11
|
|
|
14
12
|
module.exports = {
|
|
15
13
|
CDNBaseOpt: {
|
|
@@ -257,7 +255,7 @@ module.exports = {
|
|
|
257
255
|
});
|
|
258
256
|
}
|
|
259
257
|
|
|
260
|
-
uploadFile(channelID, fileName, msgContent = "", messageID = null) {
|
|
258
|
+
uploadFile(channelID, fileName, isSpoiled = false, msgContent = "", messageID = null) {
|
|
261
259
|
const fileData = fs.readFileSync(fileName);
|
|
262
260
|
|
|
263
261
|
if(fileData.length >= 26214400) return null;
|
|
@@ -621,8 +619,21 @@ module.exports = {
|
|
|
621
619
|
}
|
|
622
620
|
|
|
623
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
|
+
|
|
624
631
|
return new Promise(function(resolve) {
|
|
625
|
-
|
|
632
|
+
const req = https.request(options, function(res) {
|
|
633
|
+
res.on("end", resolve);
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
req.end();
|
|
626
637
|
}.bind(this));
|
|
627
638
|
}
|
|
628
639
|
|