@imaentity/selfjs 1.5.9 → 1.6.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/docs.md +2 -0
- package/package.json +1 -1
- package/self.js +8 -1
package/docs.md
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
- **onMessageEdit(editFunc)**: Function to be executed when a message is edited.
|
|
18
18
|
|
|
19
|
+
- **onMessageDelete(deleteFunc)**: Function to be executed when a message is deleted.
|
|
20
|
+
|
|
19
21
|
- **onStatusUpdate(statusFunc)**: Function to be executed when a status update occurs.
|
|
20
22
|
|
|
21
23
|
- **getDMChannel(userID)**: Gets the Direct Message (DM) channel for the specified user.
|
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.6.9 (Nice)
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const https = require("https");
|
|
@@ -85,6 +85,7 @@ module.exports = {
|
|
|
85
85
|
this.sequenceID = null;
|
|
86
86
|
this.resumeURL = null;
|
|
87
87
|
this.statusUpdateFunction = null;
|
|
88
|
+
this.messageDeleteFunction = null;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
login(token, isMobile = false, logMsgs = false) {
|
|
@@ -164,6 +165,8 @@ module.exports = {
|
|
|
164
165
|
try {payload.d.author.self = payload.d.author.id == this.userID;} catch(e) {}
|
|
165
166
|
|
|
166
167
|
if(typeof this.statusUpdateFunction == "function") this.statusUpdateFunction(payload.d);
|
|
168
|
+
} else if(payload.t == "MESSAGE_DELETE") {
|
|
169
|
+
if(typeof this.onDeleteFunction == "function") this.onDeleteFunction(payload.d);
|
|
167
170
|
}
|
|
168
171
|
} else if(payload.op == 7) {
|
|
169
172
|
if(logMsgs) console.log("[MainControlSocket] Reconnect message received");
|
|
@@ -199,6 +202,10 @@ module.exports = {
|
|
|
199
202
|
this.onEditFunction = editFunc;
|
|
200
203
|
}
|
|
201
204
|
|
|
205
|
+
onMessageDelete(deleteFunc) {
|
|
206
|
+
this.onDeleteFunction = deleteFunc;
|
|
207
|
+
}
|
|
208
|
+
|
|
202
209
|
onStatusUpdate(statusFunc) {
|
|
203
210
|
this.statusUpdateFunction = statusFunc;
|
|
204
211
|
}
|