djs-selfbot-v13 3.7.2 → 3.7.3
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/README.md +58 -26
- package/package.json +4 -4
- package/src/client/Client.js +7 -0
- package/src/client/actions/GuildMemberRemove.js +1 -1
- package/src/client/actions/GuildMemberUpdate.js +1 -1
- package/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +1 -1
- package/src/managers/BillingManager.js +3 -3
- package/src/managers/DeveloperManager.js +253 -0
- package/src/managers/ThreadManager.js +1 -1
- package/src/structures/ClientUser.js +2 -2
- package/src/structures/interfaces/Application.js +128 -0
- package/src/structures/interfaces/TextBasedChannel.js +27 -0
- package/typings/index.d.ts +76 -0
package/README.md
CHANGED
|
@@ -14,32 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
- discord.js-selfbot-v13 is a [Node.js](https://nodejs.org) module that allows user accounts to interact with the Discord API v9.
|
|
16
16
|
|
|
17
|
-
## Nouveautés
|
|
18
|
-
|
|
19
|
-
> **Nouvelles fonctionnalités ajoutées :**
|
|
20
|
-
- `guild.mute()` - Supprime completement les pings
|
|
21
|
-
- `guild.unmute()` - Remet les pings sur le serveur
|
|
22
|
-
|
|
23
|
-
- `rpc.setDetailsURL(url)` - Met une URL pour les details du RPC
|
|
24
|
-
- `rpc.setStateURL(url)` - Met une URL pour le state du RPC
|
|
25
|
-
|
|
26
|
-
- `client.user.setNameStyle(fontName, effectName, color1, color2?)` - Définir le style du nom d'affichage avec police, effet et couleurs
|
|
27
|
-
- `client.user.setClan(GuildID)` - Changer votre TAG de serveur
|
|
28
|
-
- `client.user.deleteClan()` - Retire le TAG de serveur
|
|
29
|
-
|
|
30
|
-
- `client.user.addWidget(type, gameId, comment?, tags?)` - Ajouter un widget de jeu au profil
|
|
31
|
-
- `client.user.delWidget(type, gameId?)` - Supprimer un widget ou un jeu spécifique
|
|
32
|
-
- `client.user.widgetsList()` - Obtenir la liste de tous les widgets
|
|
33
|
-
|
|
34
|
-
- `client.quests.get()` - Récupérer toutes les quêtes disponibles
|
|
35
|
-
- `client.quests.orbs()` - Obtenir le solde de la monnaie virtuelle
|
|
36
|
-
- `client.quests.acceptQuest(questId, options?)` - S'inscrire à une quête
|
|
37
|
-
- `client.quests.doingQuest(quest)` - Compléter automatiquement une quête
|
|
38
|
-
- `client.quests.autoCompleteAll()` - Compléter automatiquement toutes les quêtes valides
|
|
39
|
-
- `client.quests.getCompleted()` - Obtenir les quêtes terminées
|
|
40
|
-
- `client.quests.getClaimable()` - Obtenir les quêtes réclamables
|
|
41
|
-
- `client.quests.filterQuestsValid()` - Filtrer les quêtes valides
|
|
42
|
-
|
|
43
17
|
|
|
44
18
|
<div align="center">
|
|
45
19
|
<p>
|
|
@@ -49,6 +23,64 @@
|
|
|
49
23
|
</p>
|
|
50
24
|
</div>
|
|
51
25
|
|
|
26
|
+
<details>
|
|
27
|
+
<summary><strong>New Features</strong></summary>
|
|
28
|
+
|
|
29
|
+
### Guild Management
|
|
30
|
+
- `guild.mute(options?)` - Mute a guild completely (suppress all notifications)
|
|
31
|
+
- `guild.unmute()` - Unmute a guild (restore all notifications)
|
|
32
|
+
|
|
33
|
+
### Developer Applications
|
|
34
|
+
- `client.developers.get(withTeamApplications?)` - Fetch all developer applications owned by the user
|
|
35
|
+
- `client.developers.list(withTeamApplications?)` - Alias for get() method
|
|
36
|
+
- `client.developers.fetch(applicationId)` - Fetch a specific application by ID
|
|
37
|
+
- `client.developers.edit(applicationId, data)` - Edit an application with custom data
|
|
38
|
+
- `client.developers.setAvatar(applicationId, avatar)` - Set application avatar/icon
|
|
39
|
+
- `client.developers.setName(applicationId, name)` - Set application name
|
|
40
|
+
- `client.developers.setDescription(applicationId, description)` - Set application description
|
|
41
|
+
- `client.developers.setTags(applicationId, tags)` - Set application tags (max 5)
|
|
42
|
+
- `client.developers.addTag(applicationId, tag)` - Add a single tag to application
|
|
43
|
+
- `client.developers.delTag(applicationId, tag)` - Remove a tag from application
|
|
44
|
+
- `client.developers.enableIntents(applicationId)` - Enable bot intents for application
|
|
45
|
+
- `client.developers.disableIntents(applicationId)` - Disable bot intents for application
|
|
46
|
+
|
|
47
|
+
**Application Object Methods (Direct Usage):**
|
|
48
|
+
- `application.edit(data)` - Edit the application
|
|
49
|
+
- `application.setAvatar(avatar)` - Set application avatar/icon
|
|
50
|
+
- `application.setName(name)` - Set application name
|
|
51
|
+
- `application.setDescription(description)` - Set application description
|
|
52
|
+
- `application.setTags(tags)` - Set application tags (max 5)
|
|
53
|
+
- `application.addTag(tag)` - Add a single tag
|
|
54
|
+
- `application.delTag(tag)` - Remove a tag
|
|
55
|
+
- `application.enableIntents()` - Enable bot intents
|
|
56
|
+
- `application.disableIntents()` - Disable bot intents
|
|
57
|
+
|
|
58
|
+
### RPC Enhancements
|
|
59
|
+
- `rpc.setDetailsURL(url)` - Set a URL for RPC details
|
|
60
|
+
- `rpc.setStateURL(url)` - Set a URL for RPC state
|
|
61
|
+
|
|
62
|
+
### User Profile Customization
|
|
63
|
+
- `client.user.setNameStyle(fontName, effectName, color1, color2?)` - Set display name style with font, effect and colors
|
|
64
|
+
- `client.user.setClan(GuildID)` - Change your server clan tag
|
|
65
|
+
- `client.user.deleteClan()` - Remove server clan tag
|
|
66
|
+
|
|
67
|
+
### Profile Widgets
|
|
68
|
+
- `client.user.addWidget(type, gameId, comment?, tags?)` - Add a game widget to profile
|
|
69
|
+
- `client.user.delWidget(type, gameId?)` - Remove a widget or specific game
|
|
70
|
+
- `client.user.widgetsList()` - Get list of all widgets
|
|
71
|
+
|
|
72
|
+
### Quest System
|
|
73
|
+
- `client.quests.get()` - Fetch all available quests
|
|
74
|
+
- `client.quests.orbs()` - Get virtual currency balance
|
|
75
|
+
- `client.quests.acceptQuest(questId, options?)` - Accept a quest
|
|
76
|
+
- `client.quests.doingQuest(quest)` - Auto-complete a quest
|
|
77
|
+
- `client.quests.autoCompleteAll()` - Auto-complete all valid quests
|
|
78
|
+
- `client.quests.getCompleted()` - Get completed quests
|
|
79
|
+
- `client.quests.getClaimable()` - Get claimable quests
|
|
80
|
+
- `client.quests.filterQuestsValid()` - Filter valid quests
|
|
81
|
+
|
|
82
|
+
</details>
|
|
83
|
+
|
|
52
84
|
> [!WARNING]
|
|
53
85
|
> **I don't take any responsibility for blocked Discord accounts that used this module.**
|
|
54
86
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "djs-selfbot-v13",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.3",
|
|
4
4
|
"description": "An unofficial discord.js fork for creating selfbots",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./typings/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/aiko-chan-ai/
|
|
32
|
+
"url": "git+https://github.com/aiko-chan-ai/djs-selfbot-v13.git"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"discord.js",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"author": "aiko-chan-ai",
|
|
48
48
|
"license": "GNU General Public License v3.0",
|
|
49
49
|
"bugs": {
|
|
50
|
-
"url": "https://github.com/aiko-chan-ai/
|
|
50
|
+
"url": "https://github.com/aiko-chan-ai/djs-selfbot-v13/issues"
|
|
51
51
|
},
|
|
52
|
-
"homepage": "https://github.com/aiko-chan-ai/
|
|
52
|
+
"homepage": "https://github.com/aiko-chan-ai/djs-selfbot-v13#readme",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@discordjs/builders": "^1.6.3",
|
|
55
55
|
"@discordjs/collection": "^2.1.1",
|
package/src/client/Client.js
CHANGED
|
@@ -15,6 +15,7 @@ const BaseGuildEmojiManager = require('../managers/BaseGuildEmojiManager');
|
|
|
15
15
|
const BillingManager = require('../managers/BillingManager');
|
|
16
16
|
const ChannelManager = require('../managers/ChannelManager');
|
|
17
17
|
const ClientUserSettingManager = require('../managers/ClientUserSettingManager');
|
|
18
|
+
const DeveloperManager = require('../managers/DeveloperManager');
|
|
18
19
|
const GuildManager = require('../managers/GuildManager');
|
|
19
20
|
const PresenceManager = require('../managers/PresenceManager');
|
|
20
21
|
const QuestManager = require('../managers/QuestManager');
|
|
@@ -159,6 +160,12 @@ class Client extends BaseClient {
|
|
|
159
160
|
*/
|
|
160
161
|
this.billing = new BillingManager(this);
|
|
161
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Manages developer applications
|
|
165
|
+
* @type {DeveloperManager}
|
|
166
|
+
*/
|
|
167
|
+
this.developers = new DeveloperManager(this);
|
|
168
|
+
|
|
162
169
|
/**
|
|
163
170
|
* Manages quest-related API methods
|
|
164
171
|
* @type {QuestManager}
|
|
@@ -19,7 +19,7 @@ class GuildMemberRemoveAction extends Action {
|
|
|
19
19
|
* Emitted whenever a member leaves a guild, or is kicked.
|
|
20
20
|
* @event Client#guildMemberRemove
|
|
21
21
|
* @param {GuildMember} member The member that has left/been kicked from the guild
|
|
22
|
-
* @deprecated See {@link https://github.com/aiko-chan-ai/
|
|
22
|
+
* @deprecated See {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/issues/197 this issue} for more information.
|
|
23
23
|
*/
|
|
24
24
|
if (shard.status === Status.READY) client.emit(Events.GUILD_MEMBER_REMOVE, member);
|
|
25
25
|
}
|
|
@@ -25,7 +25,7 @@ class GuildMemberUpdateAction extends Action {
|
|
|
25
25
|
* @event Client#guildMemberUpdate
|
|
26
26
|
* @param {GuildMember} oldMember The member before the update
|
|
27
27
|
* @param {GuildMember} newMember The member after the update
|
|
28
|
-
* @deprecated See {@link https://github.com/aiko-chan-ai/
|
|
28
|
+
* @deprecated See {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/issues/197 this issue} for more information.
|
|
29
29
|
*/
|
|
30
30
|
if (shard.status === Status.READY && !member.equals(old)) client.emit(Events.GUILD_MEMBER_UPDATE, old, member);
|
|
31
31
|
} else {
|
|
@@ -12,7 +12,7 @@ module.exports = (client, { d: data }, shard) => {
|
|
|
12
12
|
* Emitted whenever a user joins a guild.
|
|
13
13
|
* @event Client#guildMemberAdd
|
|
14
14
|
* @param {GuildMember} member The member that has joined a guild
|
|
15
|
-
* @deprecated See {@link https://github.com/aiko-chan-ai/
|
|
15
|
+
* @deprecated See {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/issues/197 this issue} for more information.
|
|
16
16
|
*/
|
|
17
17
|
client.emit(Events.GUILD_MEMBER_ADD, member);
|
|
18
18
|
}
|
|
@@ -30,7 +30,7 @@ class BillingManager extends BaseManager {
|
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Fetches all the payment sources of the client
|
|
33
|
-
* @returns {Collection<Snowflake, Object
|
|
33
|
+
* @returns {Promise<Collection<Snowflake, Object>>}
|
|
34
34
|
*/
|
|
35
35
|
async fetchPaymentSources() {
|
|
36
36
|
// https://discord.com/api/v9/users/@me/billing/payment-sources
|
|
@@ -42,7 +42,7 @@ class BillingManager extends BaseManager {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Fetches all the guild boosts of the client
|
|
45
|
-
* @returns {Collection<Snowflake, GuildBoost
|
|
45
|
+
* @returns {Promise<Collection<Snowflake, GuildBoost>>}
|
|
46
46
|
*/
|
|
47
47
|
async fetchGuildBoosts() {
|
|
48
48
|
// https://discord.com/api/v9/users/@me/guilds/premium/subscription-slots
|
|
@@ -53,7 +53,7 @@ class BillingManager extends BaseManager {
|
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Fetches the current subscription of the client
|
|
56
|
-
* @returns {Collection<Snowflake, Object
|
|
56
|
+
* @returns {Promise<Collection<Snowflake, Object>>}
|
|
57
57
|
*/
|
|
58
58
|
async fetchCurrentSubscription() {
|
|
59
59
|
// https://discord.com/api/v9/users/@me/billing/subscriptions
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { Collection } = require('@discordjs/collection');
|
|
4
|
+
const BaseManager = require('./BaseManager');
|
|
5
|
+
const Application = require('../structures/interfaces/Application');
|
|
6
|
+
const DataResolver = require('../util/DataResolver');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Manages API methods for developer applications and provides utilities you might need.
|
|
10
|
+
* @extends {BaseManager}
|
|
11
|
+
*/
|
|
12
|
+
class DeveloperManager extends BaseManager {
|
|
13
|
+
constructor(client) {
|
|
14
|
+
super(client);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Fetches all applications owned by the current user
|
|
19
|
+
* @param {boolean} [withTeamApplications=true] Whether to include team applications
|
|
20
|
+
* @returns {Promise<Collection<Snowflake, Application>>}
|
|
21
|
+
* @example
|
|
22
|
+
* // Fetch all developer applications
|
|
23
|
+
* client.developers.get()
|
|
24
|
+
* .then(applications => console.log(`Found ${applications.size} applications`))
|
|
25
|
+
* .catch(console.error);
|
|
26
|
+
*/
|
|
27
|
+
async get(withTeamApplications = true) {
|
|
28
|
+
const data = await this.client.api.applications.get({
|
|
29
|
+
query: {
|
|
30
|
+
with_team_applications: withTeamApplications,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const applications = new Collection();
|
|
35
|
+
for (const app of data) {
|
|
36
|
+
applications.set(app.id, new Application(this.client, app));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return applications;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Alias for get() method
|
|
44
|
+
* @param {boolean} [withTeamApplications=true] Whether to include team applications
|
|
45
|
+
* @returns {Promise<Collection<Snowflake, Application>>}
|
|
46
|
+
*/
|
|
47
|
+
list(withTeamApplications = true) {
|
|
48
|
+
return this.get(withTeamApplications);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Fetches a specific application by ID
|
|
53
|
+
* @param {Snowflake} applicationId The ID of the application to fetch
|
|
54
|
+
* @returns {Promise<Application>}
|
|
55
|
+
* @example
|
|
56
|
+
* // Fetch a specific application
|
|
57
|
+
* client.developers.fetch('1234567890123456789')
|
|
58
|
+
* .then(app => console.log(`Application: ${app.name}`))
|
|
59
|
+
* .catch(console.error);
|
|
60
|
+
*/
|
|
61
|
+
async fetch(applicationId) {
|
|
62
|
+
const data = await this.client.api.applications(applicationId).get();
|
|
63
|
+
return new Application(this.client, data);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Edits an application
|
|
68
|
+
* @param {Snowflake} applicationId The ID of the application to edit
|
|
69
|
+
* @param {ApplicationEditData} data The data to edit the application with
|
|
70
|
+
* @returns {Promise<Application>}
|
|
71
|
+
* @example
|
|
72
|
+
* // Edit an application
|
|
73
|
+
* client.developers.edit('1234567890123456789', {
|
|
74
|
+
* name: 'My New Bot Name',
|
|
75
|
+
* description: 'A cool bot description',
|
|
76
|
+
* tags: ['utility', 'moderation']
|
|
77
|
+
* })
|
|
78
|
+
* .then(app => console.log(`Updated: ${app.name}`))
|
|
79
|
+
* .catch(console.error);
|
|
80
|
+
*/
|
|
81
|
+
async edit(applicationId, data) {
|
|
82
|
+
const _data = {};
|
|
83
|
+
|
|
84
|
+
if (data.name) _data.name = data.name;
|
|
85
|
+
if (data.description !== undefined) _data.description = data.description;
|
|
86
|
+
if (data.icon !== undefined) _data.icon = await DataResolver.resolveImage(data.icon);
|
|
87
|
+
if (data.tags) _data.tags = data.tags;
|
|
88
|
+
if (data.interactionsEndpointUrl !== undefined) _data.interactions_endpoint_url = data.interactionsEndpointUrl;
|
|
89
|
+
if (data.roleConnectionsVerificationUrl !== undefined) _data.role_connections_verification_url = data.roleConnectionsVerificationUrl;
|
|
90
|
+
if (data.termsOfServiceUrl !== undefined) _data.terms_of_service_url = data.termsOfServiceUrl;
|
|
91
|
+
if (data.privacyPolicyUrl !== undefined) _data.privacy_policy_url = data.privacyPolicyUrl;
|
|
92
|
+
|
|
93
|
+
const result = await this.client.api.applications(applicationId).patch({ data: _data });
|
|
94
|
+
return new Application(this.client, result);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Sets the avatar of an application
|
|
99
|
+
* @param {Snowflake} applicationId The ID of the application
|
|
100
|
+
* @param {?(BufferResolvable|Base64Resolvable)} avatar The new avatar
|
|
101
|
+
* @returns {Promise<Application>}
|
|
102
|
+
* @example
|
|
103
|
+
* // Set application avatar
|
|
104
|
+
* client.developers.setAvatar('1234567890123456789', './avatar.png')
|
|
105
|
+
* .then(app => console.log(`Updated avatar for ${app.name}`))
|
|
106
|
+
* .catch(console.error);
|
|
107
|
+
*/
|
|
108
|
+
setAvatar(applicationId, avatar) {
|
|
109
|
+
return this.edit(applicationId, { icon: avatar });
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Sets the name of an application
|
|
114
|
+
* @param {Snowflake} applicationId The ID of the application
|
|
115
|
+
* @param {string} name The new name
|
|
116
|
+
* @returns {Promise<Application>}
|
|
117
|
+
* @example
|
|
118
|
+
* // Set application name
|
|
119
|
+
* client.developers.setName('1234567890123456789', 'My Cool Bot')
|
|
120
|
+
* .then(app => console.log(`Renamed to ${app.name}`))
|
|
121
|
+
* .catch(console.error);
|
|
122
|
+
*/
|
|
123
|
+
setName(applicationId, name) {
|
|
124
|
+
return this.edit(applicationId, { name });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Sets the description of an application
|
|
129
|
+
* @param {Snowflake} applicationId The ID of the application
|
|
130
|
+
* @param {string} description The new description
|
|
131
|
+
* @returns {Promise<Application>}
|
|
132
|
+
* @example
|
|
133
|
+
* // Set application description
|
|
134
|
+
* client.developers.setDescription('1234567890123456789', 'A helpful utility bot')
|
|
135
|
+
* .then(app => console.log(`Updated description for ${app.name}`))
|
|
136
|
+
* .catch(console.error);
|
|
137
|
+
*/
|
|
138
|
+
setDescription(applicationId, description) {
|
|
139
|
+
return this.edit(applicationId, { description });
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Sets the tags of an application (max 5 tags)
|
|
144
|
+
* @param {Snowflake} applicationId The ID of the application
|
|
145
|
+
* @param {string[]} tags Array of tags (max 5)
|
|
146
|
+
* @returns {Promise<Application>}
|
|
147
|
+
* @example
|
|
148
|
+
* // Set application tags
|
|
149
|
+
* client.developers.setTags('1234567890123456789', ['utility', 'moderation', 'fun'])
|
|
150
|
+
* .then(app => console.log(`Updated tags for ${app.name}`))
|
|
151
|
+
* .catch(console.error);
|
|
152
|
+
*/
|
|
153
|
+
setTags(applicationId, tags) {
|
|
154
|
+
if (tags.length > 5) {
|
|
155
|
+
throw new Error('Maximum of 5 tags allowed');
|
|
156
|
+
}
|
|
157
|
+
return this.edit(applicationId, { tags });
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Adds a tag to an application
|
|
162
|
+
* @param {Snowflake} applicationId The ID of the application
|
|
163
|
+
* @param {string} tag The tag to add
|
|
164
|
+
* @returns {Promise<Application>}
|
|
165
|
+
* @example
|
|
166
|
+
* // Add a tag to application
|
|
167
|
+
* client.developers.addTag('1234567890123456789', 'music')
|
|
168
|
+
* .then(app => console.log(`Added tag to ${app.name}`))
|
|
169
|
+
* .catch(console.error);
|
|
170
|
+
*/
|
|
171
|
+
async addTag(applicationId, tag) {
|
|
172
|
+
const app = await this.fetch(applicationId);
|
|
173
|
+
const currentTags = app.tags || [];
|
|
174
|
+
|
|
175
|
+
if (currentTags.includes(tag)) {
|
|
176
|
+
throw new Error('Tag already exists');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (currentTags.length >= 5) {
|
|
180
|
+
throw new Error('Maximum of 5 tags allowed');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const newTags = [...currentTags, tag];
|
|
184
|
+
return this.edit(applicationId, { tags: newTags });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Removes a tag from an application
|
|
189
|
+
* @param {Snowflake} applicationId The ID of the application
|
|
190
|
+
* @param {string} tag The tag to remove
|
|
191
|
+
* @returns {Promise<Application>}
|
|
192
|
+
* @example
|
|
193
|
+
* // Remove a tag from application
|
|
194
|
+
* client.developers.delTag('1234567890123456789', 'music')
|
|
195
|
+
* .then(app => console.log(`Removed tag from ${app.name}`))
|
|
196
|
+
* .catch(console.error);
|
|
197
|
+
*/
|
|
198
|
+
async delTag(applicationId, tag) {
|
|
199
|
+
const app = await this.fetch(applicationId);
|
|
200
|
+
const currentTags = app.tags || [];
|
|
201
|
+
|
|
202
|
+
if (!currentTags.includes(tag)) {
|
|
203
|
+
throw new Error('Tag does not exist');
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const newTags = currentTags.filter(t => t !== tag);
|
|
207
|
+
return this.edit(applicationId, { tags: newTags });
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Enables intents for a bot application
|
|
212
|
+
* @param {Snowflake} applicationId The ID of the application
|
|
213
|
+
* @returns {Promise<Application>}
|
|
214
|
+
* @example
|
|
215
|
+
* // Enable intents for bot
|
|
216
|
+
* client.developers.enableIntents('1234567890123456789')
|
|
217
|
+
* .then(app => console.log(`Enabled intents for ${app.name}`))
|
|
218
|
+
* .catch(console.error);
|
|
219
|
+
*/
|
|
220
|
+
async enableIntents(applicationId) {
|
|
221
|
+
const data = await this.client.api.applications(applicationId).patch({
|
|
222
|
+
data: {
|
|
223
|
+
bot_public: true,
|
|
224
|
+
bot_require_code_grant: false,
|
|
225
|
+
flags: 25731072, // Flags with intents enabled
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
return new Application(this.client, data);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Disables intents for a bot application
|
|
233
|
+
* @param {Snowflake} applicationId The ID of the application
|
|
234
|
+
* @returns {Promise<Application>}
|
|
235
|
+
* @example
|
|
236
|
+
* // Disable intents for bot
|
|
237
|
+
* client.developers.disableIntents('1234567890123456789')
|
|
238
|
+
* .then(app => console.log(`Disabled intents for ${app.name}`))
|
|
239
|
+
* .catch(console.error);
|
|
240
|
+
*/
|
|
241
|
+
async disableIntents(applicationId) {
|
|
242
|
+
const data = await this.client.api.applications(applicationId).patch({
|
|
243
|
+
data: {
|
|
244
|
+
bot_public: true,
|
|
245
|
+
bot_require_code_grant: false,
|
|
246
|
+
flags: 25165824, // Flags with intents disabled
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
return new Application(this.client, data);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
module.exports = DeveloperManager;
|
|
@@ -161,7 +161,7 @@ class ThreadManager extends CachedManager {
|
|
|
161
161
|
// Discord sends the thread id as id in this object
|
|
162
162
|
for (const rawMember of rawThreads.members) client.channels.cache.get(rawMember.id)?.members._add(rawMember);
|
|
163
163
|
// Patch firstMessage
|
|
164
|
-
// According to https://github.com/aiko-chan-ai/
|
|
164
|
+
// According to https://github.com/aiko-chan-ai/djs-selfbot-v13/issues/1502, rawThreads.first_messages could be null.
|
|
165
165
|
for (const rawMessage of rawThreads?.first_messages || []) {
|
|
166
166
|
client.channels.cache.get(rawMessage.id)?.messages._add(rawMessage);
|
|
167
167
|
}
|
|
@@ -203,7 +203,7 @@ class ClientUser extends User {
|
|
|
203
203
|
* @example
|
|
204
204
|
* // Set the client user's presence
|
|
205
205
|
* client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' });
|
|
206
|
-
* @see {@link https://github.com/aiko-chan-ai/
|
|
206
|
+
* @see {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/blob/main/Document/RichPresence.md}
|
|
207
207
|
*/
|
|
208
208
|
setPresence(data) {
|
|
209
209
|
return this.client.presence.set(data);
|
|
@@ -248,7 +248,7 @@ class ClientUser extends User {
|
|
|
248
248
|
* @example
|
|
249
249
|
* // Set the client user's activity
|
|
250
250
|
* client.user.setActivity('discord.js', { type: 'WATCHING' });
|
|
251
|
-
* @see {@link https://github.com/aiko-chan-ai/
|
|
251
|
+
* @see {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/blob/main/Document/RichPresence.md}
|
|
252
252
|
*/
|
|
253
253
|
setActivity(name, options = {}) {
|
|
254
254
|
if (!name) return this.setPresence({ activities: [], shardId: options.shardId });
|
|
@@ -820,6 +820,134 @@ class Application extends Base {
|
|
|
820
820
|
toJSON() {
|
|
821
821
|
return super.toJSON({ createdTimestamp: true });
|
|
822
822
|
}
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Edits this application
|
|
826
|
+
* @param {ApplicationEditData} data The data to edit the application with
|
|
827
|
+
* @returns {Promise<Application>}
|
|
828
|
+
* @example
|
|
829
|
+
* // Edit the application
|
|
830
|
+
* application.edit({
|
|
831
|
+
* name: 'My New Bot Name',
|
|
832
|
+
* description: 'A cool bot description',
|
|
833
|
+
* tags: ['utility', 'moderation']
|
|
834
|
+
* })
|
|
835
|
+
* .then(app => console.log(`Updated: ${app.name}`))
|
|
836
|
+
* .catch(console.error);
|
|
837
|
+
*/
|
|
838
|
+
edit(data) {
|
|
839
|
+
return this.client.developers.edit(this.id, data);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Sets the avatar of this application
|
|
844
|
+
* @param {?(BufferResolvable|Base64Resolvable)} avatar The new avatar
|
|
845
|
+
* @returns {Promise<Application>}
|
|
846
|
+
* @example
|
|
847
|
+
* // Set application avatar
|
|
848
|
+
* application.setAvatar('./avatar.png')
|
|
849
|
+
* .then(app => console.log(`Updated avatar for ${app.name}`))
|
|
850
|
+
* .catch(console.error);
|
|
851
|
+
*/
|
|
852
|
+
setAvatar(avatar) {
|
|
853
|
+
return this.client.developers.setAvatar(this.id, avatar);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Sets the name of this application
|
|
858
|
+
* @param {string} name The new name
|
|
859
|
+
* @returns {Promise<Application>}
|
|
860
|
+
* @example
|
|
861
|
+
* // Set application name
|
|
862
|
+
* application.setName('My Cool Bot')
|
|
863
|
+
* .then(app => console.log(`Renamed to ${app.name}`))
|
|
864
|
+
* .catch(console.error);
|
|
865
|
+
*/
|
|
866
|
+
setName(name) {
|
|
867
|
+
return this.client.developers.setName(this.id, name);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Sets the description of this application
|
|
872
|
+
* @param {string} description The new description
|
|
873
|
+
* @returns {Promise<Application>}
|
|
874
|
+
* @example
|
|
875
|
+
* // Set application description
|
|
876
|
+
* application.setDescription('A helpful utility bot')
|
|
877
|
+
* .then(app => console.log(`Updated description for ${app.name}`))
|
|
878
|
+
* .catch(console.error);
|
|
879
|
+
*/
|
|
880
|
+
setDescription(description) {
|
|
881
|
+
return this.client.developers.setDescription(this.id, description);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Sets the tags of this application (max 5 tags)
|
|
886
|
+
* @param {string[]} tags Array of tags (max 5)
|
|
887
|
+
* @returns {Promise<Application>}
|
|
888
|
+
* @example
|
|
889
|
+
* // Set application tags
|
|
890
|
+
* application.setTags(['utility', 'moderation', 'fun'])
|
|
891
|
+
* .then(app => console.log(`Updated tags for ${app.name}`))
|
|
892
|
+
* .catch(console.error);
|
|
893
|
+
*/
|
|
894
|
+
setTags(tags) {
|
|
895
|
+
return this.client.developers.setTags(this.id, tags);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Adds a tag to this application
|
|
900
|
+
* @param {string} tag The tag to add
|
|
901
|
+
* @returns {Promise<Application>}
|
|
902
|
+
* @example
|
|
903
|
+
* // Add a tag to application
|
|
904
|
+
* application.addTag('music')
|
|
905
|
+
* .then(app => console.log(`Added tag to ${app.name}`))
|
|
906
|
+
* .catch(console.error);
|
|
907
|
+
*/
|
|
908
|
+
addTag(tag) {
|
|
909
|
+
return this.client.developers.addTag(this.id, tag);
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* Removes a tag from this application
|
|
914
|
+
* @param {string} tag The tag to remove
|
|
915
|
+
* @returns {Promise<Application>}
|
|
916
|
+
* @example
|
|
917
|
+
* // Remove a tag from application
|
|
918
|
+
* application.delTag('music')
|
|
919
|
+
* .then(app => console.log(`Removed tag from ${app.name}`))
|
|
920
|
+
* .catch(console.error);
|
|
921
|
+
*/
|
|
922
|
+
delTag(tag) {
|
|
923
|
+
return this.client.developers.delTag(this.id, tag);
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Enables intents for this bot application
|
|
928
|
+
* @returns {Promise<Application>}
|
|
929
|
+
* @example
|
|
930
|
+
* // Enable intents for bot
|
|
931
|
+
* application.enableIntents()
|
|
932
|
+
* .then(app => console.log(`Enabled intents for ${app.name}`))
|
|
933
|
+
* .catch(console.error);
|
|
934
|
+
*/
|
|
935
|
+
enableIntents() {
|
|
936
|
+
return this.client.developers.enableIntents(this.id);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Disables intents for this bot application
|
|
941
|
+
* @returns {Promise<Application>}
|
|
942
|
+
* @example
|
|
943
|
+
* // Disable intents for bot
|
|
944
|
+
* application.disableIntents()
|
|
945
|
+
* .then(app => console.log(`Disabled intents for ${app.name}`))
|
|
946
|
+
* .catch(console.error);
|
|
947
|
+
*/
|
|
948
|
+
disableIntents() {
|
|
949
|
+
return this.client.developers.disableIntents(this.id);
|
|
950
|
+
}
|
|
823
951
|
}
|
|
824
952
|
|
|
825
953
|
module.exports = Application;
|
|
@@ -385,6 +385,32 @@ class TextBasedChannel {
|
|
|
385
385
|
return Util.createPromiseInteraction(this.client, nonce, 5000);
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
/**
|
|
389
|
+
* Search messages in this channel by user
|
|
390
|
+
* @param {number} limit Number of messages to return
|
|
391
|
+
* @param {UserResolvable} user User whose messages to search for
|
|
392
|
+
* @returns {Promise<Object[]|false>} Array of messages or false if failed
|
|
393
|
+
* @example
|
|
394
|
+
* // Search for messages from a user
|
|
395
|
+
* channel.search(10, user)
|
|
396
|
+
* .then(messages => console.log(`Found ${messages.length} messages`))
|
|
397
|
+
* .catch(console.error);
|
|
398
|
+
*/
|
|
399
|
+
async search(limit, user) {
|
|
400
|
+
const userId = this.client.users.resolveId(user);
|
|
401
|
+
if (!userId) throw new Error('INVALID_TYPE', 'user', 'UserResolvable');
|
|
402
|
+
|
|
403
|
+
const res = await fetch(`https://ptb.discord.com/api/v9/${this.guild ? `guilds/${this.guild.id}` : `channels/${this.id}`}/messages/search?author_id=${userId}&channel_id=${this.id}&sort_by=timestamp&sort_order=desc&offset=0`, {
|
|
404
|
+
method: 'GET',
|
|
405
|
+
headers: { authorization: this.client.token }
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
if (!res.ok) return false;
|
|
409
|
+
|
|
410
|
+
const data = await res.json();
|
|
411
|
+
return data.messages.splice(0, limit);
|
|
412
|
+
}
|
|
413
|
+
|
|
388
414
|
/**
|
|
389
415
|
* Sends a typing indicator in the channel.
|
|
390
416
|
* @returns {Promise<{ message_send_cooldown_ms: number, thread_create_cooldown_ms: number }|void>} Resolves upon the typing status being sent
|
|
@@ -511,6 +537,7 @@ class TextBasedChannel {
|
|
|
511
537
|
'searchInteractionUserApps',
|
|
512
538
|
'lastMessage',
|
|
513
539
|
'lastPinAt',
|
|
540
|
+
'search',
|
|
514
541
|
'sendTyping',
|
|
515
542
|
'createMessageCollector',
|
|
516
543
|
'awaitMessages',
|
package/typings/index.d.ts
CHANGED
|
@@ -426,6 +426,15 @@ export abstract class Application extends Base {
|
|
|
426
426
|
public iconURL(options?: StaticImageURLOptions): string | null;
|
|
427
427
|
public toJSON(): unknown;
|
|
428
428
|
public toString(): string | null;
|
|
429
|
+
public edit(data: ApplicationEditData): Promise<Application>;
|
|
430
|
+
public setAvatar(avatar: BufferResolvable | Base64Resolvable | null): Promise<Application>;
|
|
431
|
+
public setName(name: string): Promise<Application>;
|
|
432
|
+
public setDescription(description: string): Promise<Application>;
|
|
433
|
+
public setTags(tags: string[]): Promise<Application>;
|
|
434
|
+
public addTag(tag: string): Promise<Application>;
|
|
435
|
+
public delTag(tag: string): Promise<Application>;
|
|
436
|
+
public enableIntents(): Promise<Application>;
|
|
437
|
+
public disableIntents(): Promise<Application>;
|
|
429
438
|
}
|
|
430
439
|
|
|
431
440
|
export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
|
|
@@ -862,6 +871,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
|
|
|
862
871
|
public sessions: SessionManager;
|
|
863
872
|
public presences: PresenceManager;
|
|
864
873
|
public billing: BillingManager;
|
|
874
|
+
public developers: DeveloperManager;
|
|
865
875
|
public quests: QuestManager;
|
|
866
876
|
public settings: ClientUserSettingManager;
|
|
867
877
|
public readonly sessionId: If<Ready, string, undefined>;
|
|
@@ -1593,6 +1603,7 @@ export class Guild extends AnonymousGuild {
|
|
|
1593
1603
|
public safetyAlertsChannelId: Snowflake | null;
|
|
1594
1604
|
public scheduledEvents: GuildScheduledEventManager;
|
|
1595
1605
|
public settings: GuildSettingManager;
|
|
1606
|
+
public profile: GuildProfile;
|
|
1596
1607
|
public readonly shard: WebSocketShard;
|
|
1597
1608
|
public shardId: number;
|
|
1598
1609
|
public stageInstances: StageInstanceManager;
|
|
@@ -2648,6 +2659,22 @@ export class BillingManager extends BaseManager {
|
|
|
2648
2659
|
public fetchCurrentSubscription(): Promise<Collection<Snowflake, object>>;
|
|
2649
2660
|
}
|
|
2650
2661
|
|
|
2662
|
+
export class DeveloperManager extends BaseManager {
|
|
2663
|
+
constructor(client: Client);
|
|
2664
|
+
public get(withTeamApplications?: boolean): Promise<Collection<Snowflake, Application>>;
|
|
2665
|
+
public list(withTeamApplications?: boolean): Promise<Collection<Snowflake, Application>>;
|
|
2666
|
+
public fetch(applicationId: Snowflake): Promise<Application>;
|
|
2667
|
+
public edit(applicationId: Snowflake, data: ApplicationEditData): Promise<Application>;
|
|
2668
|
+
public setAvatar(applicationId: Snowflake, avatar: BufferResolvable | Base64Resolvable | null): Promise<Application>;
|
|
2669
|
+
public setName(applicationId: Snowflake, name: string): Promise<Application>;
|
|
2670
|
+
public setDescription(applicationId: Snowflake, description: string): Promise<Application>;
|
|
2671
|
+
public setTags(applicationId: Snowflake, tags: string[]): Promise<Application>;
|
|
2672
|
+
public addTag(applicationId: Snowflake, tag: string): Promise<Application>;
|
|
2673
|
+
public delTag(applicationId: Snowflake, tag: string): Promise<Application>;
|
|
2674
|
+
public enableIntents(applicationId: Snowflake): Promise<Application>;
|
|
2675
|
+
public disableIntents(applicationId: Snowflake): Promise<Application>;
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2651
2678
|
export class QuestManager extends BaseManager {
|
|
2652
2679
|
constructor(client: Client);
|
|
2653
2680
|
public cache: Collection<string, Quest>;
|
|
@@ -2687,6 +2714,32 @@ export interface SessionClientInfo {
|
|
|
2687
2714
|
os?: string;
|
|
2688
2715
|
}
|
|
2689
2716
|
|
|
2717
|
+
export class GuildProfile extends Base {
|
|
2718
|
+
private constructor(guild: Guild);
|
|
2719
|
+
public guild: Guild;
|
|
2720
|
+
public bio: string | null;
|
|
2721
|
+
public pronouns: string | null;
|
|
2722
|
+
public accentColor: number | null;
|
|
2723
|
+
public banner: string | null;
|
|
2724
|
+
public themeColors: number[] | null;
|
|
2725
|
+
public popoutAnimationParticleType: number | null;
|
|
2726
|
+
public emojiId: Snowflake | null;
|
|
2727
|
+
public guildId: Snowflake;
|
|
2728
|
+
public badge: string | null;
|
|
2729
|
+
public tag: string | null;
|
|
2730
|
+
public bannerURL(options?: StaticImageURLOptions): string | null;
|
|
2731
|
+
public edit(data: GuildProfileEditData): Promise<GuildProfile>;
|
|
2732
|
+
public setBio(bio: string | null): Promise<GuildProfile>;
|
|
2733
|
+
public setPronouns(pronouns: string | null): Promise<GuildProfile>;
|
|
2734
|
+
public setAccentColor(color: ColorResolvable | null): Promise<GuildProfile>;
|
|
2735
|
+
public setBanner(banner: BufferResolvable | Base64Resolvable | null): Promise<GuildProfile>;
|
|
2736
|
+
public setThemeColors(colors: ColorResolvable[] | null): Promise<GuildProfile>;
|
|
2737
|
+
public setPopoutAnimationParticleType(type: number | null): Promise<GuildProfile>;
|
|
2738
|
+
public setEmojiId(emojiId: Snowflake | null): Promise<GuildProfile>;
|
|
2739
|
+
public setBadge(badge: string | null): Promise<GuildProfile>;
|
|
2740
|
+
public setTag(tag: string | null): Promise<GuildProfile>;
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2690
2743
|
export class GuildBoost extends Base {
|
|
2691
2744
|
constructor(client: Client, data: object);
|
|
2692
2745
|
public id: Snowflake;
|
|
@@ -6190,6 +6243,17 @@ export interface ClientUserEditData {
|
|
|
6190
6243
|
bio?: string;
|
|
6191
6244
|
}
|
|
6192
6245
|
|
|
6246
|
+
export interface ApplicationEditData {
|
|
6247
|
+
name?: string;
|
|
6248
|
+
description?: string;
|
|
6249
|
+
icon?: BufferResolvable | Base64Resolvable | null;
|
|
6250
|
+
tags?: string[];
|
|
6251
|
+
interactionsEndpointUrl?: string | null;
|
|
6252
|
+
roleConnectionsVerificationUrl?: string | null;
|
|
6253
|
+
termsOfServiceUrl?: string | null;
|
|
6254
|
+
privacyPolicyUrl?: string | null;
|
|
6255
|
+
}
|
|
6256
|
+
|
|
6193
6257
|
export interface CloseEvent {
|
|
6194
6258
|
wasClean: boolean;
|
|
6195
6259
|
code: number;
|
|
@@ -7072,6 +7136,18 @@ export interface GuildMemberEditData {
|
|
|
7072
7136
|
bio?: string | null;
|
|
7073
7137
|
}
|
|
7074
7138
|
|
|
7139
|
+
export interface GuildProfileEditData {
|
|
7140
|
+
bio?: string | null;
|
|
7141
|
+
pronouns?: string | null;
|
|
7142
|
+
accentColor?: ColorResolvable | null;
|
|
7143
|
+
banner?: BufferResolvable | Base64Resolvable | null;
|
|
7144
|
+
themeColors?: ColorResolvable[] | null;
|
|
7145
|
+
popoutAnimationParticleType?: number | null;
|
|
7146
|
+
emojiId?: Snowflake | null;
|
|
7147
|
+
badge?: string | null;
|
|
7148
|
+
tag?: string | null;
|
|
7149
|
+
}
|
|
7150
|
+
|
|
7075
7151
|
export type GuildMemberFlagsString =
|
|
7076
7152
|
| 'DID_REJOIN'
|
|
7077
7153
|
| 'COMPLETED_ONBOARDING'
|