discord-self-lite 0.1.16 → 0.1.17
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
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "discord-self-lite",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Lightweight Discord selfbot library",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"discord",
|
|
7
|
-
"selfbot",
|
|
8
|
-
"bot",
|
|
9
|
-
"api",
|
|
10
|
-
"websocket",
|
|
11
|
-
"discord-api",
|
|
12
|
-
"discord-bot",
|
|
13
|
-
"discord-selfbot",
|
|
14
|
-
"lightweight",
|
|
15
|
-
"nodejs"
|
|
16
|
-
],
|
|
17
|
-
"main": "src/index.js",
|
|
18
|
-
"files": [
|
|
19
|
-
"src",
|
|
20
|
-
"README.md",
|
|
21
|
-
"LICENSE"
|
|
22
|
-
],
|
|
23
|
-
"exports": {
|
|
24
|
-
".": "./src/index.js",
|
|
25
|
-
"./classes/Client": "./src/classes/Client.js",
|
|
26
|
-
"./classes/WebhookClient": "./src/connection/webhook/WebhookClient.js"
|
|
27
|
-
},
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=18.13.0"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"
|
|
33
|
-
"format": "prettier --write .",
|
|
34
|
-
"fix": "eslint . --fix && prettier --write .",
|
|
35
|
-
"docs": "echo \"📚 Documentation available at docs/README.md\""
|
|
36
|
-
},
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git",
|
|
39
|
-
"url": "git+https://github.com/kyan0045/discord-self-lite.git"
|
|
40
|
-
},
|
|
41
|
-
"author": {
|
|
42
|
-
"name": "Kyan Bosman",
|
|
43
|
-
"email": "contact@kyanbosman.com",
|
|
44
|
-
"url": "https://github.com/kyan0045"
|
|
45
|
-
},
|
|
46
|
-
"license": "GPL-3.0-or-later",
|
|
47
|
-
"bugs": {
|
|
48
|
-
"url": "https://github.com/kyan0045/discord-self-lite/issues"
|
|
49
|
-
},
|
|
50
|
-
"homepage": "https://github.com/kyan0045/discord-self-lite#readme",
|
|
51
|
-
"funding": {
|
|
52
|
-
"type": "github",
|
|
53
|
-
"url": "https://github.com/sponsors/kyan0045"
|
|
54
|
-
},
|
|
55
|
-
"dependencies": {
|
|
56
|
-
"ws": "^8.
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"eslint-config-prettier": "^10.1.8",
|
|
60
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
61
|
-
"prettier": "^3.6.2"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "discord-self-lite",
|
|
3
|
+
"version": "0.1.17",
|
|
4
|
+
"description": "Lightweight Discord selfbot library",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"discord",
|
|
7
|
+
"selfbot",
|
|
8
|
+
"bot",
|
|
9
|
+
"api",
|
|
10
|
+
"websocket",
|
|
11
|
+
"discord-api",
|
|
12
|
+
"discord-bot",
|
|
13
|
+
"discord-selfbot",
|
|
14
|
+
"lightweight",
|
|
15
|
+
"nodejs"
|
|
16
|
+
],
|
|
17
|
+
"main": "src/index.js",
|
|
18
|
+
"files": [
|
|
19
|
+
"src",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./src/index.js",
|
|
25
|
+
"./classes/Client": "./src/classes/Client.js",
|
|
26
|
+
"./classes/WebhookClient": "./src/connection/webhook/WebhookClient.js"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18.13.0"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"lint": "eslint src tests eslint.config.js && prettier --check src tests eslint.config.js package.json package-lock.json .github/workflows",
|
|
33
|
+
"format": "prettier --write .",
|
|
34
|
+
"fix": "eslint . --fix && prettier --write .",
|
|
35
|
+
"docs": "echo \"📚 Documentation available at docs/README.md\""
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/kyan0045/discord-self-lite.git"
|
|
40
|
+
},
|
|
41
|
+
"author": {
|
|
42
|
+
"name": "Kyan Bosman",
|
|
43
|
+
"email": "contact@kyanbosman.com",
|
|
44
|
+
"url": "https://github.com/kyan0045"
|
|
45
|
+
},
|
|
46
|
+
"license": "GPL-3.0-or-later",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/kyan0045/discord-self-lite/issues"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/kyan0045/discord-self-lite#readme",
|
|
51
|
+
"funding": {
|
|
52
|
+
"type": "github",
|
|
53
|
+
"url": "https://github.com/sponsors/kyan0045"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"ws": "^8.21.1"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"eslint-config-prettier": "^10.1.8",
|
|
60
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
61
|
+
"prettier": "^3.6.2"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/src/classes/Message.js
CHANGED
|
@@ -93,6 +93,15 @@ class Message {
|
|
|
93
93
|
return this;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Delete this message
|
|
98
|
+
* @returns {Promise<Message>} This message instance after deletion
|
|
99
|
+
*/
|
|
100
|
+
async delete() {
|
|
101
|
+
await this.client.rest.deleteMessage(this.channelId, this.id);
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
|
|
96
105
|
/**
|
|
97
106
|
* Get the guild this message was sent in
|
|
98
107
|
* @returns {Guild|null} The guild instance, or null if message was sent in DM
|
|
@@ -619,6 +619,18 @@ class RestManager {
|
|
|
619
619
|
return updatedData;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
+
/**
|
|
623
|
+
* Delete a message from a channel
|
|
624
|
+
* @param {string} channelId - The channel ID
|
|
625
|
+
* @param {string} messageId - The message ID
|
|
626
|
+
* @returns {Promise<void>}
|
|
627
|
+
*/
|
|
628
|
+
async deleteMessage(channelId, messageId) {
|
|
629
|
+
await this.request(`/channels/${channelId}/messages/${messageId}`, {
|
|
630
|
+
method: "DELETE",
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
|
|
622
634
|
/**
|
|
623
635
|
* React to a message
|
|
624
636
|
* @param {string} channelId - The channel ID
|
|
@@ -349,6 +349,12 @@ class WebhookClient {
|
|
|
349
349
|
if (options.threadId) {
|
|
350
350
|
payload.thread_id = options.threadId;
|
|
351
351
|
}
|
|
352
|
+
if (options.attachments !== undefined) {
|
|
353
|
+
payload.attachments = options.attachments;
|
|
354
|
+
}
|
|
355
|
+
if (options.files !== undefined) {
|
|
356
|
+
payload.files = options.files;
|
|
357
|
+
}
|
|
352
358
|
|
|
353
359
|
return payload;
|
|
354
360
|
}
|