@imaentity/selfjs 1.3.9 → 1.5.8
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/docs.md +2 -2
- package/package.json +1 -1
- package/self.js +9 -9
package/docs.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
- **getRoles(serverID, userID)**: Gets the roles for a user in a server.
|
|
24
24
|
|
|
25
|
-
- **uploadFile(channelID, fileName, msgContent = "", messageID = null)**: Uploads a file to the specified channel.
|
|
25
|
+
- **uploadFile(channelID, fileName, isSpoiled = false, msgContent = "", messageID = null)**: Uploads a file to the specified channel.
|
|
26
26
|
|
|
27
27
|
- **search(channelID, options)**: Search for messages in a channel based on the specified options.
|
|
28
28
|
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
- **deleteMessage(channelID, messageID)**: Deletes a message.
|
|
66
66
|
|
|
67
|
-
- **setStatus(status,
|
|
67
|
+
- **setStatus(status, activities, afk = false)**: Sets the status of the client.
|
|
68
68
|
|
|
69
69
|
- **createChannel(userIDs)**: Creates a new channel with the specified users.
|
|
70
70
|
|
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.
|
|
5
|
+
* @version 1.4.8
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const https = require("https");
|
|
@@ -23,8 +23,10 @@ module.exports = {
|
|
|
23
23
|
status: {
|
|
24
24
|
DEFAULT: -1,
|
|
25
25
|
PLAYING: 0,
|
|
26
|
+
STREAMING: 1,
|
|
26
27
|
LISTENING: 2,
|
|
27
28
|
WATCHING: 3,
|
|
29
|
+
CUSTOM: 4,
|
|
28
30
|
COMPETING: 5
|
|
29
31
|
},
|
|
30
32
|
|
|
@@ -322,6 +324,7 @@ module.exports = {
|
|
|
322
324
|
requestChunks.push(chunk);
|
|
323
325
|
}).on("end", function() {
|
|
324
326
|
const requestResData = JSON.parse(Buffer.concat(requestChunks));
|
|
327
|
+
|
|
325
328
|
const fileOptions = {
|
|
326
329
|
host: "discord-attachments-uploads-prd.storage.googleapis.com",
|
|
327
330
|
port: 443,
|
|
@@ -344,7 +347,7 @@ module.exports = {
|
|
|
344
347
|
attachments: [
|
|
345
348
|
{
|
|
346
349
|
id: '0',
|
|
347
|
-
filename: fileName,
|
|
350
|
+
filename: (isSpoiled ? "SPOILER_" : "") + fileName,
|
|
348
351
|
uploaded_filename: requestResData.attachments[0].upload_filename
|
|
349
352
|
}
|
|
350
353
|
]
|
|
@@ -869,18 +872,15 @@ module.exports = {
|
|
|
869
872
|
});
|
|
870
873
|
}
|
|
871
874
|
|
|
872
|
-
setStatus(status,
|
|
873
|
-
return new Promise(function(resolve) {
|
|
875
|
+
setStatus(status, activities, afk = false) {
|
|
876
|
+
return new Promise(function (resolve) {
|
|
874
877
|
this.socket.send(JSON.stringify({
|
|
875
878
|
op: 3,
|
|
876
879
|
d: {
|
|
877
880
|
since: Date.now(),
|
|
878
881
|
status,
|
|
879
|
-
activities
|
|
880
|
-
|
|
881
|
-
type
|
|
882
|
-
}],
|
|
883
|
-
afk: false
|
|
882
|
+
activities,
|
|
883
|
+
afk
|
|
884
884
|
}
|
|
885
885
|
}));
|
|
886
886
|
|