disgroove 2.2.7-dev.fca4921 → 3.0.0-dev.2cf2b90
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/LICENSE +9 -9
- package/README.md +48 -48
- package/dist/lib/Client.d.ts +332 -301
- package/dist/lib/Client.js +562 -462
- package/dist/lib/constants.d.ts +35 -24
- package/dist/lib/constants.js +39 -27
- package/dist/lib/gateway/Dispatcher.d.ts +104 -0
- package/dist/lib/gateway/Dispatcher.js +471 -0
- package/dist/lib/gateway/Shard.d.ts +12 -21
- package/dist/lib/gateway/Shard.js +121 -570
- package/dist/lib/gateway/Transmitter.d.ts +22 -0
- package/dist/lib/gateway/Transmitter.js +93 -0
- package/dist/lib/gateway/WebSocketManager.d.ts +22 -0
- package/dist/lib/gateway/WebSocketManager.js +93 -0
- package/dist/lib/index.d.ts +5 -1
- package/dist/lib/index.js +5 -1
- package/dist/lib/rest/Endpoints.d.ts +95 -91
- package/dist/lib/rest/Endpoints.js +111 -102
- package/dist/lib/rest/RequestManager.d.ts +1 -3
- package/dist/lib/rest/RequestManager.js +17 -7
- package/dist/lib/rest/index.js +17 -7
- package/dist/lib/transformers/ApplicationCommands.js +4 -4
- package/dist/lib/transformers/Applications.d.ts +2 -0
- package/dist/lib/transformers/Applications.js +110 -4
- package/dist/lib/transformers/AuditLogs.js +10 -10
- package/dist/lib/transformers/AutoModeration.js +6 -6
- package/dist/lib/transformers/Channels.js +16 -16
- package/dist/lib/transformers/Components.d.ts +15 -3
- package/dist/lib/transformers/Components.js +309 -156
- package/dist/lib/transformers/Entitlements.d.ts +2 -2
- package/dist/lib/transformers/Entitlements.js +16 -16
- package/dist/lib/transformers/GuildScheduledEvents.js +8 -8
- package/dist/lib/transformers/GuildTemplates.js +4 -4
- package/dist/lib/transformers/Guilds.js +28 -28
- package/dist/lib/transformers/Interactions.js +330 -55
- package/dist/lib/transformers/Lobbies.d.ts +7 -0
- package/dist/lib/transformers/Lobbies.js +38 -0
- package/dist/lib/transformers/Messages.d.ts +4 -3
- package/dist/lib/transformers/Messages.js +38 -52
- package/dist/lib/transformers/Polls.js +2 -2
- package/dist/lib/transformers/Presences.d.ts +3 -3
- package/dist/lib/transformers/Presences.js +6 -6
- package/dist/lib/transformers/Roles.js +8 -8
- package/dist/lib/transformers/SKUs.js +2 -2
- package/dist/lib/transformers/Soundboards.js +6 -6
- package/dist/lib/transformers/StageInstances.js +6 -6
- package/dist/lib/transformers/Stickers.js +3 -3
- package/dist/lib/transformers/Subscriptions.js +8 -8
- package/dist/lib/transformers/Teams.js +4 -4
- package/dist/lib/transformers/Users.js +6 -6
- package/dist/lib/transformers/Voice.js +8 -8
- package/dist/lib/transformers/Webhooks.js +6 -6
- package/dist/lib/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- package/dist/lib/types/application-command.d.ts +9 -4
- package/dist/lib/types/application-role-connection-metadata.d.ts +1 -0
- package/dist/lib/types/application.d.ts +12 -7
- package/dist/lib/types/audit-log.d.ts +9 -5
- package/dist/lib/types/auto-moderation.d.ts +7 -3
- package/dist/lib/types/channel.d.ts +17 -23
- package/dist/lib/types/common.d.ts +2 -0
- package/dist/lib/types/components.d.ts +510 -0
- package/dist/lib/types/emoji.d.ts +1 -0
- package/dist/lib/types/entitlements.d.ts +5 -4
- package/dist/lib/types/gateway-events.d.ts +406 -207
- package/dist/lib/types/guild-scheduled-event.d.ts +10 -5
- package/dist/lib/types/guild-template.d.ts +3 -2
- package/dist/lib/types/guild.d.ts +40 -22
- package/dist/lib/types/interaction.d.ts +35 -18
- package/dist/lib/types/invite.d.ts +5 -2
- package/dist/lib/types/lobby.d.ts +31 -0
- package/dist/lib/types/lobby.js +2 -0
- package/dist/lib/types/message.d.ts +32 -20
- package/dist/lib/types/poll.d.ts +7 -1
- package/dist/lib/types/role.d.ts +8 -5
- package/dist/lib/types/sku.d.ts +2 -1
- package/dist/lib/types/soundboard.d.ts +4 -3
- package/dist/lib/types/stage-instance.d.ts +4 -3
- package/dist/lib/types/sticker.d.ts +8 -5
- package/dist/lib/types/subscription.d.ts +6 -5
- package/dist/lib/types/team.d.ts +4 -2
- package/dist/lib/types/user.d.ts +10 -3
- package/dist/lib/types/voice.d.ts +6 -4
- package/dist/lib/types/webhook.d.ts +4 -3
- package/dist/lib/utils/CDN.d.ts +22 -22
- package/dist/lib/utils/CDN.js +22 -22
- package/dist/lib/utils/errors.d.ts +3 -1
- package/dist/lib/utils/errors.js +4 -0
- package/dist/lib/utils/formatters.d.ts +7 -7
- package/dist/lib/utils/formatters.js +28 -29
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +18 -7
- package/dist/lib/utils/permissions.d.ts +2 -0
- package/dist/lib/utils/permissions.js +7 -0
- package/dist/package.json +4 -4
- package/package.json +5 -5
- package/dist/lib/types/message-components.d.ts +0 -234
- /package/dist/lib/types/{message-components.js → components.js} +0 -0
package/dist/lib/Client.js
CHANGED
|
@@ -18,6 +18,7 @@ class Client extends node_events_1.default {
|
|
|
18
18
|
intents;
|
|
19
19
|
shardsCount;
|
|
20
20
|
auth;
|
|
21
|
+
reconnect;
|
|
21
22
|
shards;
|
|
22
23
|
rest;
|
|
23
24
|
guildShardMap;
|
|
@@ -40,17 +41,18 @@ class Client extends node_events_1.default {
|
|
|
40
41
|
: 0;
|
|
41
42
|
this.shardsCount = options?.shardsCount ?? "auto";
|
|
42
43
|
this.auth = options?.auth ?? "Bot";
|
|
44
|
+
this.reconnect = options?.reconnect ?? true;
|
|
43
45
|
this.shards = new Map();
|
|
44
46
|
this.rest = new rest_1.RequestManager(token, this.auth);
|
|
45
|
-
this.guildShardMap =
|
|
47
|
+
this.guildShardMap = new Map();
|
|
46
48
|
this.user = null;
|
|
47
49
|
this.guilds = new Map();
|
|
48
50
|
this.application = null;
|
|
49
51
|
this.ws = options?.ws;
|
|
50
52
|
}
|
|
51
53
|
/** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient */
|
|
52
|
-
addGroupRecipient(
|
|
53
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelRecipient(
|
|
54
|
+
addGroupRecipient(channelId, userId, options) {
|
|
55
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelRecipient(channelId, userId), {
|
|
54
56
|
json: {
|
|
55
57
|
access_token: options.accessToken,
|
|
56
58
|
nick: options.nick,
|
|
@@ -58,8 +60,8 @@ class Client extends node_events_1.default {
|
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
62
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member */
|
|
61
|
-
async addGuildMember(
|
|
62
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildMember(
|
|
63
|
+
async addGuildMember(guildId, userId, options) {
|
|
64
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildMember(guildId, userId), {
|
|
63
65
|
json: {
|
|
64
66
|
access_token: options.accessToken,
|
|
65
67
|
nick: options.nick,
|
|
@@ -71,18 +73,25 @@ class Client extends node_events_1.default {
|
|
|
71
73
|
return response !== null ? transformers_1.Guilds.guildMemberFromRaw(response) : null;
|
|
72
74
|
}
|
|
73
75
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
|
|
74
|
-
addGuildMemberRole(
|
|
75
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildMemberRole(
|
|
76
|
+
addGuildMemberRole(guildId, userId, roleId, reason) {
|
|
77
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildMemberRole(guildId, userId, roleId), {
|
|
76
78
|
reason,
|
|
77
79
|
});
|
|
78
80
|
}
|
|
81
|
+
/** https://discord.com/developers/docs/resources/lobby#add-a-member-to-a-lobby */
|
|
82
|
+
async addLobbyMember(lobbyId, userId, options) {
|
|
83
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbyMember(lobbyId, userId), {
|
|
84
|
+
json: options,
|
|
85
|
+
});
|
|
86
|
+
return transformers_1.Lobbies.lobbyMemberFromRaw(response);
|
|
87
|
+
}
|
|
79
88
|
/** https://discord.com/developers/docs/resources/channel#add-thread-member */
|
|
80
|
-
addThreadMember(
|
|
81
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(
|
|
89
|
+
addThreadMember(channelId, userId) {
|
|
90
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelId, userId));
|
|
82
91
|
}
|
|
83
92
|
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
|
|
84
|
-
beginGuildPrune(
|
|
85
|
-
return this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildPrune(
|
|
93
|
+
beginGuildPrune(guildId, options, reason) {
|
|
94
|
+
return this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildPrune(guildId), {
|
|
86
95
|
json: {
|
|
87
96
|
days: options.days,
|
|
88
97
|
compute_prune_count: options.computePruneCount,
|
|
@@ -92,10 +101,10 @@ class Client extends node_events_1.default {
|
|
|
92
101
|
});
|
|
93
102
|
}
|
|
94
103
|
/** https://discord.com/developers/docs/resources/guild#bulk-guild-ban */
|
|
95
|
-
async bulkGuildBan(
|
|
96
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildBulkBan(
|
|
104
|
+
async bulkGuildBan(guildId, options, reason) {
|
|
105
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildBulkBan(guildId), {
|
|
97
106
|
json: {
|
|
98
|
-
user_ids: options.
|
|
107
|
+
user_ids: options.userIds,
|
|
99
108
|
delete_message_seconds: options.deleteMessageSeconds,
|
|
100
109
|
},
|
|
101
110
|
reason,
|
|
@@ -106,8 +115,8 @@ class Client extends node_events_1.default {
|
|
|
106
115
|
};
|
|
107
116
|
}
|
|
108
117
|
/** https://discord.com/developers/docs/resources/message#bulk-delete-messages */
|
|
109
|
-
bulkDeleteMessages(
|
|
110
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelBulkDelete(
|
|
118
|
+
bulkDeleteMessages(channelId, options, reason) {
|
|
119
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelBulkDelete(channelId), {
|
|
111
120
|
json: {
|
|
112
121
|
messages: options?.messages,
|
|
113
122
|
},
|
|
@@ -115,8 +124,8 @@ class Client extends node_events_1.default {
|
|
|
115
124
|
});
|
|
116
125
|
}
|
|
117
126
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
|
|
118
|
-
async bulkEditGlobalApplicationCommands(
|
|
119
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommands(
|
|
127
|
+
async bulkEditGlobalApplicationCommands(applicationId, commands) {
|
|
128
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommands(applicationId), {
|
|
120
129
|
json: commands.map((command) => ({
|
|
121
130
|
id: command.id,
|
|
122
131
|
name: command.name,
|
|
@@ -134,8 +143,8 @@ class Client extends node_events_1.default {
|
|
|
134
143
|
return response.map((c) => transformers_1.ApplicationCommands.applicationCommandFromRaw(c));
|
|
135
144
|
}
|
|
136
145
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
|
|
137
|
-
async bulkEditGuildApplicationCommands(
|
|
138
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationGuildCommands(
|
|
146
|
+
async bulkEditGuildApplicationCommands(applicationId, guildId, commands) {
|
|
147
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationGuildCommands(applicationId, guildId), {
|
|
139
148
|
json: commands.map((command) => ({
|
|
140
149
|
id: command.id,
|
|
141
150
|
name: command.name,
|
|
@@ -161,12 +170,12 @@ class Client extends node_events_1.default {
|
|
|
161
170
|
this.shards.forEach((shard) => shard.connect());
|
|
162
171
|
}
|
|
163
172
|
/** https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement */
|
|
164
|
-
consumeEntitlement(
|
|
165
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlementConsume(
|
|
173
|
+
consumeEntitlement(applicationId, entitlementId) {
|
|
174
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlementConsume(applicationId, entitlementId));
|
|
166
175
|
}
|
|
167
176
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
|
168
|
-
async createAutoModerationRule(
|
|
169
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildAutoModerationRules(
|
|
177
|
+
async createAutoModerationRule(guildId, options, reason) {
|
|
178
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildAutoModerationRules(guildId), {
|
|
170
179
|
json: {
|
|
171
180
|
name: options.name,
|
|
172
181
|
event_type: options.eventType,
|
|
@@ -184,15 +193,15 @@ class Client extends node_events_1.default {
|
|
|
184
193
|
return transformers_1.AutoModeration.autoModerationRuleFromRaw(response);
|
|
185
194
|
}
|
|
186
195
|
/** https://discord.com/developers/docs/resources/emoji#create-application-emoji */
|
|
187
|
-
async createApplicationEmoji(
|
|
188
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEmojis(
|
|
196
|
+
async createApplicationEmoji(applicationId, options) {
|
|
197
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEmojis(applicationId), {
|
|
189
198
|
json: options,
|
|
190
199
|
});
|
|
191
200
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
192
201
|
}
|
|
193
202
|
/** https://discord.com/developers/docs/resources/guild#create-guild-channel */
|
|
194
|
-
async createChannel(
|
|
195
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildChannels(
|
|
203
|
+
async createChannel(guildId, options, reason) {
|
|
204
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildChannels(guildId), {
|
|
196
205
|
json: {
|
|
197
206
|
name: options.name,
|
|
198
207
|
type: options.type,
|
|
@@ -202,7 +211,7 @@ class Client extends node_events_1.default {
|
|
|
202
211
|
rate_limit_per_user: options.rateLimitPerUser,
|
|
203
212
|
position: options.position,
|
|
204
213
|
permission_overwrites: options.permissionOverwrites,
|
|
205
|
-
parent_id: options.
|
|
214
|
+
parent_id: options.parentId,
|
|
206
215
|
nsfw: options.nsfw,
|
|
207
216
|
rtc_region: options.rtcRegion,
|
|
208
217
|
video_quality_mode: options.videoQualityMode,
|
|
@@ -210,7 +219,7 @@ class Client extends node_events_1.default {
|
|
|
210
219
|
default_reaction_emoji: options.defaultReactionEmoji !== undefined
|
|
211
220
|
? options.defaultReactionEmoji !== null
|
|
212
221
|
? {
|
|
213
|
-
emoji_id: options.defaultReactionEmoji.
|
|
222
|
+
emoji_id: options.defaultReactionEmoji.emojiId,
|
|
214
223
|
emoji_name: options.defaultReactionEmoji.emojiName,
|
|
215
224
|
}
|
|
216
225
|
: null
|
|
@@ -225,24 +234,24 @@ class Client extends node_events_1.default {
|
|
|
225
234
|
return transformers_1.Channels.channelFromRaw(response);
|
|
226
235
|
}
|
|
227
236
|
/** https://discord.com/developers/docs/resources/channel#create-channel-invite */
|
|
228
|
-
async createChannelInvite(
|
|
229
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelInvites(
|
|
237
|
+
async createChannelInvite(channelId, options, reason) {
|
|
238
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelInvites(channelId), {
|
|
230
239
|
json: {
|
|
231
240
|
max_age: options.maxAge,
|
|
232
241
|
max_uses: options.maxUses,
|
|
233
242
|
temporary: options.temporary,
|
|
234
243
|
unique: options.unique,
|
|
235
244
|
target_type: options.targetType,
|
|
236
|
-
target_user_id: options.
|
|
237
|
-
target_application_id: options.
|
|
245
|
+
target_user_id: options.targetUserId,
|
|
246
|
+
target_application_id: options.targetApplicationId,
|
|
238
247
|
},
|
|
239
248
|
reason,
|
|
240
249
|
});
|
|
241
250
|
return transformers_1.Invites.inviteFromRaw(response);
|
|
242
251
|
}
|
|
243
252
|
/** https://discord.com/developers/docs/resources/webhook#create-webhook */
|
|
244
|
-
async createChannelWebhook(
|
|
245
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelWebhooks(
|
|
253
|
+
async createChannelWebhook(channelId, options, reason) {
|
|
254
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelWebhooks(channelId), {
|
|
246
255
|
json: {
|
|
247
256
|
name: options.name,
|
|
248
257
|
avatar: options.avatar,
|
|
@@ -255,14 +264,14 @@ class Client extends node_events_1.default {
|
|
|
255
264
|
async createDM(options) {
|
|
256
265
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.userChannels(), {
|
|
257
266
|
json: {
|
|
258
|
-
recipient_id: options.
|
|
267
|
+
recipient_id: options.recipientId,
|
|
259
268
|
},
|
|
260
269
|
});
|
|
261
270
|
return transformers_1.Channels.channelFromRaw(response);
|
|
262
271
|
}
|
|
263
272
|
/** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
|
|
264
|
-
async createGlobalApplicationCommand(
|
|
265
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationCommands(
|
|
273
|
+
async createGlobalApplicationCommand(applicationId, options) {
|
|
274
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationCommands(applicationId), {
|
|
266
275
|
json: {
|
|
267
276
|
name: options.name,
|
|
268
277
|
name_localizations: options.nameLocalizations,
|
|
@@ -289,8 +298,8 @@ class Client extends node_events_1.default {
|
|
|
289
298
|
return transformers_1.Channels.channelFromRaw(response);
|
|
290
299
|
}
|
|
291
300
|
/** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
|
|
292
|
-
async createGuildApplicationCommand(
|
|
293
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationGuildCommands(
|
|
301
|
+
async createGuildApplicationCommand(applicationId, guildId, options) {
|
|
302
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationGuildCommands(applicationId, guildId), {
|
|
294
303
|
json: {
|
|
295
304
|
name: options.name,
|
|
296
305
|
name_localizations: options.nameLocalizations,
|
|
@@ -305,8 +314,8 @@ class Client extends node_events_1.default {
|
|
|
305
314
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
306
315
|
}
|
|
307
316
|
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
|
|
308
|
-
createGuildBan(
|
|
309
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildBan(
|
|
317
|
+
createGuildBan(guildId, userId, options, reason) {
|
|
318
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildBan(guildId, userId), {
|
|
310
319
|
json: {
|
|
311
320
|
delete_message_days: options?.deleteMessageDays,
|
|
312
321
|
delete_message_seconds: options?.deleteMessageSeconds,
|
|
@@ -315,8 +324,8 @@ class Client extends node_events_1.default {
|
|
|
315
324
|
});
|
|
316
325
|
}
|
|
317
326
|
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
|
|
318
|
-
async createGuildEmoji(
|
|
319
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildEmojis(
|
|
327
|
+
async createGuildEmoji(guildId, options, reason) {
|
|
328
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildEmojis(guildId), {
|
|
320
329
|
json: {
|
|
321
330
|
name: options.name,
|
|
322
331
|
image: options.image,
|
|
@@ -327,12 +336,17 @@ class Client extends node_events_1.default {
|
|
|
327
336
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
328
337
|
}
|
|
329
338
|
/** https://discord.com/developers/docs/resources/guild#create-guild-role */
|
|
330
|
-
async createGuildRole(
|
|
331
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildRoles(
|
|
339
|
+
async createGuildRole(guildId, options, reason) {
|
|
340
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildRoles(guildId), {
|
|
332
341
|
json: {
|
|
333
342
|
name: options.name,
|
|
334
343
|
permissions: options.permissions,
|
|
335
344
|
color: options.color,
|
|
345
|
+
colors: {
|
|
346
|
+
primary_color: options.colors?.primaryColor,
|
|
347
|
+
secondary_color: options.colors?.secondaryColor,
|
|
348
|
+
tertiary_color: options.colors?.tertiaryColor,
|
|
349
|
+
},
|
|
336
350
|
hoist: options.hoist,
|
|
337
351
|
icon: options.icon,
|
|
338
352
|
unicode_emoji: options.unicodeEmoji,
|
|
@@ -343,10 +357,10 @@ class Client extends node_events_1.default {
|
|
|
343
357
|
return transformers_1.Roles.roleFromRaw(response);
|
|
344
358
|
}
|
|
345
359
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
|
|
346
|
-
async createGuildScheduledEvent(
|
|
347
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildScheduledEvents(
|
|
360
|
+
async createGuildScheduledEvent(guildId, options, reason) {
|
|
361
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildScheduledEvents(guildId), {
|
|
348
362
|
json: {
|
|
349
|
-
channel_id: options.
|
|
363
|
+
channel_id: options.channelId,
|
|
350
364
|
entity_metadata: options.entityMetadata,
|
|
351
365
|
name: options.name,
|
|
352
366
|
privacy_level: options.privacyLevel,
|
|
@@ -364,26 +378,26 @@ class Client extends node_events_1.default {
|
|
|
364
378
|
return transformers_1.GuildScheduledEvents.guildScheduledEventFromRaw(response);
|
|
365
379
|
}
|
|
366
380
|
/** https://discord.com/developers/docs/resources/sticker#create-guild-sticker */
|
|
367
|
-
async createGuildSticker(
|
|
381
|
+
async createGuildSticker(guildId, options, reason) {
|
|
368
382
|
const formData = new FormData();
|
|
369
383
|
formData.set("name", options.name);
|
|
370
384
|
formData.set("description", options.description);
|
|
371
385
|
formData.set("tags", options.tags);
|
|
372
386
|
formData.set("file", new Blob([options.file.contents]), options.file.name);
|
|
373
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildStickers(
|
|
387
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildStickers(guildId), {
|
|
374
388
|
form: formData,
|
|
375
389
|
reason,
|
|
376
390
|
});
|
|
377
391
|
return transformers_1.Stickers.stickerFromRaw(response);
|
|
378
392
|
}
|
|
379
393
|
/** https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound */
|
|
380
|
-
async createGuildSoundboardSound(
|
|
381
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSounds(
|
|
394
|
+
async createGuildSoundboardSound(guildId, options, reason) {
|
|
395
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSounds(guildId), {
|
|
382
396
|
json: {
|
|
383
397
|
name: options.name,
|
|
384
398
|
sound: options.sound,
|
|
385
399
|
volume: options.volume,
|
|
386
|
-
emoji_id: options.
|
|
400
|
+
emoji_id: options.emojiId,
|
|
387
401
|
emoji_name: options.emojiName,
|
|
388
402
|
},
|
|
389
403
|
reason,
|
|
@@ -391,8 +405,8 @@ class Client extends node_events_1.default {
|
|
|
391
405
|
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
|
392
406
|
}
|
|
393
407
|
/** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
|
|
394
|
-
async createGuildTemplate(
|
|
395
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildTemplates(
|
|
408
|
+
async createGuildTemplate(guildId, options) {
|
|
409
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildTemplates(guildId), {
|
|
396
410
|
json: {
|
|
397
411
|
name: options.name,
|
|
398
412
|
description: options.description,
|
|
@@ -401,8 +415,8 @@ class Client extends node_events_1.default {
|
|
|
401
415
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
402
416
|
}
|
|
403
417
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */
|
|
404
|
-
async createInteractionFollowupMessage(
|
|
405
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(
|
|
418
|
+
async createInteractionFollowupMessage(applicationId, interactionToken, options) {
|
|
419
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(applicationId, interactionToken), {
|
|
406
420
|
json: {
|
|
407
421
|
content: options.content,
|
|
408
422
|
tts: options.tts,
|
|
@@ -427,7 +441,7 @@ class Client extends node_events_1.default {
|
|
|
427
441
|
? {
|
|
428
442
|
question: options.poll.question,
|
|
429
443
|
answers: options.poll.answers.map((answer) => ({
|
|
430
|
-
answer_id: answer.
|
|
444
|
+
answer_id: answer.answerId,
|
|
431
445
|
poll_media: answer.pollMedia,
|
|
432
446
|
})),
|
|
433
447
|
duration: options.poll.duration,
|
|
@@ -441,7 +455,7 @@ class Client extends node_events_1.default {
|
|
|
441
455
|
return transformers_1.Messages.messageFromRaw(response);
|
|
442
456
|
}
|
|
443
457
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
|
|
444
|
-
async createInteractionResponse(
|
|
458
|
+
async createInteractionResponse(interactionId, interactionToken, options) {
|
|
445
459
|
let json;
|
|
446
460
|
let files;
|
|
447
461
|
switch (options.type) {
|
|
@@ -465,14 +479,31 @@ class Client extends node_events_1.default {
|
|
|
465
479
|
: undefined,
|
|
466
480
|
flags: options.data?.flags,
|
|
467
481
|
components: options.data?.components !== undefined
|
|
468
|
-
?
|
|
482
|
+
? options.data?.components.map((component) => {
|
|
483
|
+
switch (component.type) {
|
|
484
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
485
|
+
return transformers_1.Components.actionRowToRaw(component);
|
|
486
|
+
case constants_1.ComponentTypes.Section:
|
|
487
|
+
return transformers_1.Components.sectionToRaw(component);
|
|
488
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
489
|
+
return transformers_1.Components.textDisplayToRaw(component);
|
|
490
|
+
case constants_1.ComponentTypes.MediaGallery:
|
|
491
|
+
return transformers_1.Components.mediaGalleryToRaw(component);
|
|
492
|
+
case constants_1.ComponentTypes.File:
|
|
493
|
+
return transformers_1.Components.fileToRaw(component);
|
|
494
|
+
case constants_1.ComponentTypes.Separator:
|
|
495
|
+
return transformers_1.Components.separatorToRaw(component);
|
|
496
|
+
case constants_1.ComponentTypes.Container:
|
|
497
|
+
return transformers_1.Components.containerToRaw(component);
|
|
498
|
+
}
|
|
499
|
+
})
|
|
469
500
|
: undefined,
|
|
470
501
|
attachments: options.data?.attachments,
|
|
471
502
|
poll: options.data?.poll !== undefined
|
|
472
503
|
? {
|
|
473
504
|
question: options.data.poll.question,
|
|
474
505
|
answers: options.data.poll.answers.map((answer) => ({
|
|
475
|
-
answer_id: answer.
|
|
506
|
+
answer_id: answer.answerId,
|
|
476
507
|
poll_media: answer.pollMedia,
|
|
477
508
|
})),
|
|
478
509
|
duration: options.data.poll.duration,
|
|
@@ -515,9 +546,18 @@ class Client extends node_events_1.default {
|
|
|
515
546
|
json = {
|
|
516
547
|
type: options.type,
|
|
517
548
|
data: {
|
|
518
|
-
custom_id: options.data?.
|
|
549
|
+
custom_id: options.data?.customId,
|
|
519
550
|
components: options.data?.components !== undefined
|
|
520
|
-
?
|
|
551
|
+
? options.data?.components.map((component) => {
|
|
552
|
+
switch (component.type) {
|
|
553
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
554
|
+
return transformers_1.Components.actionRowToRaw(component);
|
|
555
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
556
|
+
return transformers_1.Components.textDisplayToRaw(component);
|
|
557
|
+
case constants_1.ComponentTypes.Label:
|
|
558
|
+
return transformers_1.Components.labelToRaw(component);
|
|
559
|
+
}
|
|
560
|
+
})
|
|
521
561
|
: undefined,
|
|
522
562
|
title: options.data?.title,
|
|
523
563
|
},
|
|
@@ -535,7 +575,7 @@ class Client extends node_events_1.default {
|
|
|
535
575
|
break;
|
|
536
576
|
}
|
|
537
577
|
if (options.withResponse) {
|
|
538
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(
|
|
578
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionId, interactionToken), {
|
|
539
579
|
json,
|
|
540
580
|
query: {
|
|
541
581
|
with_response: options.withResponse,
|
|
@@ -545,7 +585,7 @@ class Client extends node_events_1.default {
|
|
|
545
585
|
return transformers_1.Interactions.interactionCallbackResponseFromRaw(response);
|
|
546
586
|
}
|
|
547
587
|
else {
|
|
548
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(
|
|
588
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionId, interactionToken), {
|
|
549
589
|
json,
|
|
550
590
|
query: {
|
|
551
591
|
with_response: options.withResponse,
|
|
@@ -554,9 +594,20 @@ class Client extends node_events_1.default {
|
|
|
554
594
|
});
|
|
555
595
|
}
|
|
556
596
|
}
|
|
597
|
+
/** https://discord.com/developers/docs/resources/lobby#create-lobby */
|
|
598
|
+
async createLobby(options) {
|
|
599
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbies(), {
|
|
600
|
+
json: {
|
|
601
|
+
metadata: options.metadata,
|
|
602
|
+
members: options.members,
|
|
603
|
+
idle_timeout_seconds: options.idleTimeoutSeconds,
|
|
604
|
+
},
|
|
605
|
+
});
|
|
606
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
607
|
+
}
|
|
557
608
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
558
|
-
async createMessage(
|
|
559
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(
|
|
609
|
+
async createMessage(channelId, options) {
|
|
610
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelId), {
|
|
560
611
|
json: {
|
|
561
612
|
content: options.content,
|
|
562
613
|
nonce: options.nonce,
|
|
@@ -572,16 +623,16 @@ class Client extends node_events_1.default {
|
|
|
572
623
|
: undefined,
|
|
573
624
|
message_reference: options.messageReference !== undefined
|
|
574
625
|
? {
|
|
575
|
-
message_id: options.messageReference.
|
|
576
|
-
channel_id: options.messageReference.
|
|
577
|
-
guild_id: options.messageReference.
|
|
626
|
+
message_id: options.messageReference.messageId,
|
|
627
|
+
channel_id: options.messageReference.channelId,
|
|
628
|
+
guild_id: options.messageReference.guildId,
|
|
578
629
|
fail_if_not_exists: options.messageReference.failIfNotExists,
|
|
579
630
|
}
|
|
580
631
|
: undefined,
|
|
581
632
|
components: options.components !== undefined
|
|
582
633
|
? transformers_1.Messages.componentsToRaw(options.components)
|
|
583
634
|
: undefined,
|
|
584
|
-
stickers_ids: options.
|
|
635
|
+
stickers_ids: options.stickersIds,
|
|
585
636
|
attachments: options.attachments,
|
|
586
637
|
flags: options.flags,
|
|
587
638
|
enforce_nonce: options.enforceNonce,
|
|
@@ -589,7 +640,7 @@ class Client extends node_events_1.default {
|
|
|
589
640
|
? {
|
|
590
641
|
question: options.poll.question,
|
|
591
642
|
answers: options.poll.answers.map((answer) => ({
|
|
592
|
-
answer_id: answer.
|
|
643
|
+
answer_id: answer.answerId,
|
|
593
644
|
poll_media: answer.pollMedia,
|
|
594
645
|
})),
|
|
595
646
|
duration: options.poll.duration,
|
|
@@ -603,37 +654,37 @@ class Client extends node_events_1.default {
|
|
|
603
654
|
return transformers_1.Messages.messageFromRaw(response);
|
|
604
655
|
}
|
|
605
656
|
/** https://discord.com/developers/docs/resources/message#create-reaction */
|
|
606
|
-
createMessageReaction(
|
|
607
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelMessageReaction(
|
|
657
|
+
createMessageReaction(channelId, messageId, emoji) {
|
|
658
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelMessageReaction(channelId, messageId, emoji));
|
|
608
659
|
}
|
|
609
660
|
/** https://discord.com/developers/docs/resources/stage-instance#create-stage-instance */
|
|
610
661
|
async createStageInstance(options, reason) {
|
|
611
662
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.stageInstances(), {
|
|
612
663
|
json: {
|
|
613
|
-
channel_id: options.
|
|
664
|
+
channel_id: options.channelId,
|
|
614
665
|
topic: options.topic,
|
|
615
666
|
privacy_level: options.privacyLevel,
|
|
616
667
|
send_start_notifications: options.sendStartNotifications,
|
|
617
|
-
guild_scheduled_event_id: options.
|
|
668
|
+
guild_scheduled_event_id: options.guildScheduledEventId,
|
|
618
669
|
},
|
|
619
670
|
reason,
|
|
620
671
|
});
|
|
621
672
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
|
622
673
|
}
|
|
623
674
|
/** https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */
|
|
624
|
-
async createTestEntitlement(
|
|
625
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlements(
|
|
675
|
+
async createTestEntitlement(applicationId, options) {
|
|
676
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlements(applicationId), {
|
|
626
677
|
json: {
|
|
627
|
-
sku_id: options.
|
|
628
|
-
owner_id: options.
|
|
678
|
+
sku_id: options.skuId,
|
|
679
|
+
owner_id: options.ownerId,
|
|
629
680
|
owner_type: options.ownerType,
|
|
630
681
|
},
|
|
631
682
|
});
|
|
632
683
|
return transformers_1.Entitlements.testEntitlementFromRaw(response);
|
|
633
684
|
}
|
|
634
685
|
/** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel */
|
|
635
|
-
async createThread(
|
|
636
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(
|
|
686
|
+
async createThread(channelId, options, reason) {
|
|
687
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelId), {
|
|
637
688
|
json: {
|
|
638
689
|
name: options.name,
|
|
639
690
|
auto_archive_duration: options.autoArchiveDuration,
|
|
@@ -649,7 +700,7 @@ class Client extends node_events_1.default {
|
|
|
649
700
|
replied_user: options.message.allowedMentions.repliedUser,
|
|
650
701
|
}
|
|
651
702
|
: undefined,
|
|
652
|
-
sticker_ids: options.message.
|
|
703
|
+
sticker_ids: options.message.stickerIds,
|
|
653
704
|
attachments: options.message.attachments,
|
|
654
705
|
flags: options.message.flags,
|
|
655
706
|
},
|
|
@@ -661,8 +712,8 @@ class Client extends node_events_1.default {
|
|
|
661
712
|
return transformers_1.Channels.channelFromRaw(response);
|
|
662
713
|
}
|
|
663
714
|
/** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
|
|
664
|
-
async createThreadFromMessage(
|
|
665
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(
|
|
715
|
+
async createThreadFromMessage(channelId, messageId, options, reason) {
|
|
716
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelId, messageId), {
|
|
666
717
|
json: {
|
|
667
718
|
name: options.name,
|
|
668
719
|
auto_archive_duration: options.autoArchiveDuration,
|
|
@@ -673,8 +724,8 @@ class Client extends node_events_1.default {
|
|
|
673
724
|
return transformers_1.Channels.channelFromRaw(response);
|
|
674
725
|
}
|
|
675
726
|
/** https://discord.com/developers/docs/resources/channel#start-thread-without-message */
|
|
676
|
-
async createThreadWithoutMessage(
|
|
677
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(
|
|
727
|
+
async createThreadWithoutMessage(channelId, options, reason) {
|
|
728
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelId), {
|
|
678
729
|
json: {
|
|
679
730
|
name: options.name,
|
|
680
731
|
auto_archive_duration: options.autoArchiveDuration,
|
|
@@ -687,82 +738,82 @@ class Client extends node_events_1.default {
|
|
|
687
738
|
return transformers_1.Channels.channelFromRaw(response);
|
|
688
739
|
}
|
|
689
740
|
/** https://discord.com/developers/docs/resources/message#crosspost-message */
|
|
690
|
-
async crosspostMessage(
|
|
691
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessage(
|
|
741
|
+
async crosspostMessage(channelId, messageId) {
|
|
742
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessage(channelId, messageId));
|
|
692
743
|
return transformers_1.Messages.messageFromRaw(response);
|
|
693
744
|
}
|
|
694
745
|
/** https://discord.com/developers/docs/resources/message#delete-all-reactions */
|
|
695
|
-
deleteAllMessageReactions(
|
|
696
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageAllReactions(
|
|
746
|
+
deleteAllMessageReactions(channelId, messageId, emoji) {
|
|
747
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageAllReactions(channelId, messageId, emoji));
|
|
697
748
|
}
|
|
698
749
|
/** https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
|
|
699
|
-
deleteAutoModerationRule(
|
|
700
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildAutoModerationRule(
|
|
750
|
+
deleteAutoModerationRule(guildId, autoModerationRuleId, reason) {
|
|
751
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildAutoModerationRule(guildId, autoModerationRuleId), {
|
|
701
752
|
reason,
|
|
702
753
|
});
|
|
703
754
|
}
|
|
704
755
|
/** https://discord.com/developers/docs/resources/emoji#delete-application-emoji */
|
|
705
|
-
deleteApplicationEmoji(
|
|
706
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationEmoji(
|
|
756
|
+
deleteApplicationEmoji(applicationId, emojiId) {
|
|
757
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationEmoji(applicationId, emojiId));
|
|
707
758
|
}
|
|
708
759
|
/** https://discord.com/developers/docs/resources/channel#deleteclose-channel */
|
|
709
|
-
async deleteChannel(
|
|
710
|
-
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channel(
|
|
760
|
+
async deleteChannel(channelId, reason) {
|
|
761
|
+
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channel(channelId), {
|
|
711
762
|
reason,
|
|
712
763
|
});
|
|
713
764
|
return transformers_1.Channels.channelFromRaw(response);
|
|
714
765
|
}
|
|
715
766
|
/** https://discord.com/developers/docs/resources/channel#delete-channel-permission */
|
|
716
|
-
deleteChannelPermission(
|
|
717
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPermission(
|
|
767
|
+
deleteChannelPermission(channelId, overwriteId, reason) {
|
|
768
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPermission(channelId, overwriteId), {
|
|
718
769
|
reason,
|
|
719
770
|
});
|
|
720
771
|
}
|
|
721
772
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
|
|
722
|
-
deleteGlobalApplicationCommand(
|
|
723
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationCommand(
|
|
773
|
+
deleteGlobalApplicationCommand(applicationId, commandId) {
|
|
774
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationCommand(applicationId, commandId));
|
|
724
775
|
}
|
|
725
776
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
|
726
|
-
deleteGuildApplicationCommand(
|
|
727
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationGuildCommand(
|
|
777
|
+
deleteGuildApplicationCommand(applicationId, guildId, commandId) {
|
|
778
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationGuildCommand(applicationId, guildId, commandId));
|
|
728
779
|
}
|
|
729
780
|
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
|
730
|
-
deleteGuildEmoji(
|
|
731
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildEmoji(
|
|
781
|
+
deleteGuildEmoji(guildId, emojiId, reason) {
|
|
782
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildEmoji(guildId, emojiId), {
|
|
732
783
|
reason,
|
|
733
784
|
});
|
|
734
785
|
}
|
|
735
786
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-integration */
|
|
736
|
-
deleteGuildIntegration(
|
|
737
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildIntegration(
|
|
787
|
+
deleteGuildIntegration(guildId, integrationId, reason) {
|
|
788
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildIntegration(guildId, integrationId), {
|
|
738
789
|
reason,
|
|
739
790
|
});
|
|
740
791
|
}
|
|
741
792
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-role */
|
|
742
|
-
deleteGuildRole(
|
|
743
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildRole(
|
|
793
|
+
deleteGuildRole(guildId, roleId, reason) {
|
|
794
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildRole(guildId, roleId), {
|
|
744
795
|
reason,
|
|
745
796
|
});
|
|
746
797
|
}
|
|
747
798
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event */
|
|
748
|
-
deleteGuildScheduledEvent(
|
|
749
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildScheduledEvent(
|
|
799
|
+
deleteGuildScheduledEvent(guildId, guildScheduledEventId) {
|
|
800
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildScheduledEvent(guildId, guildScheduledEventId));
|
|
750
801
|
}
|
|
751
802
|
/** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
|
|
752
|
-
deleteGuildSticker(
|
|
753
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildSticker(
|
|
803
|
+
deleteGuildSticker(guildId, stickerId, reason) {
|
|
804
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildSticker(guildId, stickerId), {
|
|
754
805
|
reason,
|
|
755
806
|
});
|
|
756
807
|
}
|
|
757
808
|
/** https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound */
|
|
758
|
-
deleteGuildSoundboardSound(
|
|
759
|
-
this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(
|
|
809
|
+
deleteGuildSoundboardSound(guildId, soundId, reason) {
|
|
810
|
+
this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildId, soundId), {
|
|
760
811
|
reason,
|
|
761
812
|
});
|
|
762
813
|
}
|
|
763
814
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
|
764
|
-
async deleteGuildTemplate(
|
|
765
|
-
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildTemplate(
|
|
815
|
+
async deleteGuildTemplate(guildId, code) {
|
|
816
|
+
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildTemplate(guildId, code));
|
|
766
817
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
767
818
|
}
|
|
768
819
|
/** https://discord.com/developers/docs/resources/invite#delete-invite */
|
|
@@ -773,60 +824,65 @@ class Client extends node_events_1.default {
|
|
|
773
824
|
return transformers_1.Invites.inviteFromRaw(response);
|
|
774
825
|
}
|
|
775
826
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message */
|
|
776
|
-
deleteInteractionFollowupMessage(
|
|
777
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(
|
|
827
|
+
deleteInteractionFollowupMessage(applicationId, interactionToken, messageId) {
|
|
828
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationId, interactionToken, messageId));
|
|
778
829
|
}
|
|
779
830
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response */
|
|
780
|
-
deleteInteractionResponse(
|
|
781
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(
|
|
831
|
+
deleteInteractionResponse(applicationId, interactionToken) {
|
|
832
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationId, interactionToken));
|
|
833
|
+
}
|
|
834
|
+
/** https://discord.com/developers/docs/resources/lobby#delete-lobby */
|
|
835
|
+
deleteLobby(lobbyId) {
|
|
836
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobby(lobbyId));
|
|
782
837
|
}
|
|
783
838
|
/** https://discord.com/developers/docs/resources/message#delete-message */
|
|
784
|
-
deleteMessage(
|
|
785
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessage(
|
|
839
|
+
deleteMessage(channelId, messageId, reason) {
|
|
840
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessage(channelId, messageId), {
|
|
786
841
|
reason,
|
|
787
842
|
});
|
|
788
843
|
}
|
|
789
844
|
/** https://discord.com/developers/docs/resources/message#delete-user-reaction */
|
|
790
|
-
deleteMessageReaction(
|
|
791
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageReaction(
|
|
845
|
+
deleteMessageReaction(channelId, messageId, emoji, userId) {
|
|
846
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageReaction(channelId, messageId, emoji, userId));
|
|
792
847
|
}
|
|
793
848
|
/** https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance */
|
|
794
|
-
deleteStageInstance(
|
|
795
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.stageInstance(
|
|
849
|
+
deleteStageInstance(channelId, reason) {
|
|
850
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.stageInstance(channelId), {
|
|
796
851
|
reason,
|
|
797
852
|
});
|
|
798
853
|
}
|
|
799
854
|
/** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
|
|
800
|
-
deleteTestEntitlement(
|
|
801
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationEntitlement(
|
|
855
|
+
deleteTestEntitlement(applicationId, entitlementId) {
|
|
856
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationEntitlement(applicationId, entitlementId));
|
|
802
857
|
}
|
|
803
858
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook */
|
|
804
|
-
deleteWebhook(
|
|
805
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(
|
|
859
|
+
deleteWebhook(webhookId, reason) {
|
|
860
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(webhookId), {
|
|
806
861
|
reason,
|
|
807
862
|
});
|
|
808
863
|
}
|
|
809
864
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook-message */
|
|
810
|
-
deleteWebhookMessage(
|
|
811
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(
|
|
865
|
+
deleteWebhookMessage(webhookId, webhookToken, messageId, options) {
|
|
866
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(webhookId, webhookToken, messageId), {
|
|
812
867
|
query: {
|
|
813
|
-
thread_id: options?.
|
|
868
|
+
thread_id: options?.threadId,
|
|
814
869
|
},
|
|
815
870
|
});
|
|
816
871
|
}
|
|
817
872
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */
|
|
818
|
-
deleteWebhookWithToken(
|
|
819
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(
|
|
873
|
+
deleteWebhookWithToken(webhookId, webhookToken, reason) {
|
|
874
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(webhookId, webhookToken), {
|
|
820
875
|
reason,
|
|
821
876
|
authorization: false,
|
|
822
877
|
});
|
|
823
878
|
}
|
|
879
|
+
/** https://discord.com/developers/docs/events/gateway#initiating-a-disconnect */
|
|
824
880
|
disconnect() {
|
|
825
|
-
this.shards.forEach((shard) => shard.disconnect());
|
|
881
|
+
this.shards.forEach((shard) => shard.disconnect(false));
|
|
826
882
|
}
|
|
827
883
|
/** https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule */
|
|
828
|
-
async editAutoModerationRule(
|
|
829
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildAutoModerationRule(
|
|
884
|
+
async editAutoModerationRule(guildId, autoModerationRuleId, options, reason) {
|
|
885
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildAutoModerationRule(guildId, autoModerationRuleId), {
|
|
830
886
|
json: {
|
|
831
887
|
name: options.name,
|
|
832
888
|
event_type: options.eventType,
|
|
@@ -844,8 +900,8 @@ class Client extends node_events_1.default {
|
|
|
844
900
|
return transformers_1.AutoModeration.autoModerationRuleFromRaw(response);
|
|
845
901
|
}
|
|
846
902
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
|
847
|
-
async editApplicationCommandPermissions(
|
|
848
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommandPermissions(
|
|
903
|
+
async editApplicationCommandPermissions(applicationId, guildId, commandId, options) {
|
|
904
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommandPermissions(applicationId, guildId, commandId), {
|
|
849
905
|
json: {
|
|
850
906
|
permissions: options.permissions.map((permission) => ({
|
|
851
907
|
id: permission.type,
|
|
@@ -857,15 +913,15 @@ class Client extends node_events_1.default {
|
|
|
857
913
|
return transformers_1.Guilds.guildApplicationCommandPermissionsFromRaw(response);
|
|
858
914
|
}
|
|
859
915
|
/** https://discord.com/developers/docs/resources/emoji#modify-application-emoji */
|
|
860
|
-
async editApplicationEmoji(
|
|
861
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationEmoji(
|
|
916
|
+
async editApplicationEmoji(applicationId, emojiId, options) {
|
|
917
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationEmoji(applicationId, emojiId), {
|
|
862
918
|
json: options,
|
|
863
919
|
});
|
|
864
920
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
865
921
|
}
|
|
866
922
|
/** https://discord.com/developers/docs/resources/channel#modify-channel */
|
|
867
|
-
async editChannel(
|
|
868
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channel(
|
|
923
|
+
async editChannel(channelId, options, reason) {
|
|
924
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channel(channelId), {
|
|
869
925
|
json: {
|
|
870
926
|
name: options.name,
|
|
871
927
|
icon: options.icon,
|
|
@@ -877,7 +933,7 @@ class Client extends node_events_1.default {
|
|
|
877
933
|
bitrate: options.bitrate,
|
|
878
934
|
user_limit: options.userLimit,
|
|
879
935
|
permission_overwrites: options.permissionOverwrites,
|
|
880
|
-
parent_id: options.
|
|
936
|
+
parent_id: options.parentId,
|
|
881
937
|
rtc_region: options.rtcRegion,
|
|
882
938
|
video_quality_mode: options.videoQualityMode,
|
|
883
939
|
default_auto_archive_duration: options.defaultAutoArchiveDuration,
|
|
@@ -886,7 +942,7 @@ class Client extends node_events_1.default {
|
|
|
886
942
|
default_reaction_emoji: options.defaultReactionEmoji !== undefined
|
|
887
943
|
? options.defaultReactionEmoji !== null
|
|
888
944
|
? {
|
|
889
|
-
emoji_id: options.defaultReactionEmoji.
|
|
945
|
+
emoji_id: options.defaultReactionEmoji.emojiId,
|
|
890
946
|
emoji_name: options.defaultReactionEmoji.emojiName,
|
|
891
947
|
}
|
|
892
948
|
: null
|
|
@@ -905,20 +961,20 @@ class Client extends node_events_1.default {
|
|
|
905
961
|
return transformers_1.Channels.channelFromRaw(response);
|
|
906
962
|
}
|
|
907
963
|
/** https://discord.com/developers/docs/resources/channel#edit-channel-permissions */
|
|
908
|
-
editChannelPermissions(
|
|
909
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPermission(
|
|
964
|
+
editChannelPermissions(channelId, overwriteId, options, reason) {
|
|
965
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPermission(channelId, overwriteId), {
|
|
910
966
|
json: options,
|
|
911
967
|
reason,
|
|
912
968
|
});
|
|
913
969
|
}
|
|
914
970
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
|
|
915
|
-
editChannelPositions(
|
|
916
|
-
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildChannels(
|
|
971
|
+
editChannelPositions(guildId, options) {
|
|
972
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildChannels(guildId), {
|
|
917
973
|
json: options.map((data) => ({
|
|
918
974
|
id: data.id,
|
|
919
975
|
position: data.position,
|
|
920
976
|
lock_permissions: data.lockPermissions,
|
|
921
|
-
parent_id: data.
|
|
977
|
+
parent_id: data.parentId,
|
|
922
978
|
})),
|
|
923
979
|
});
|
|
924
980
|
}
|
|
@@ -934,20 +990,18 @@ class Client extends node_events_1.default {
|
|
|
934
990
|
return transformers_1.Users.userFromRaw(response);
|
|
935
991
|
}
|
|
936
992
|
/** https://discord.com/developers/docs/resources/guild#modify-current-member */
|
|
937
|
-
async editCurrentGuildMember(
|
|
938
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(
|
|
939
|
-
json:
|
|
940
|
-
nick: options.nick,
|
|
941
|
-
},
|
|
993
|
+
async editCurrentGuildMember(guildId, options, reason) {
|
|
994
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(guildId), {
|
|
995
|
+
json: options,
|
|
942
996
|
reason,
|
|
943
997
|
});
|
|
944
998
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
945
999
|
}
|
|
946
1000
|
/** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
|
|
947
|
-
editCurrentUserVoiceState(
|
|
948
|
-
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(
|
|
1001
|
+
editCurrentUserVoiceState(guildId, options) {
|
|
1002
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(guildId), {
|
|
949
1003
|
json: {
|
|
950
|
-
channel_id: options.
|
|
1004
|
+
channel_id: options.channelId,
|
|
951
1005
|
suppress: options.suppress,
|
|
952
1006
|
requestToSpeakTimestamp: options.requestToSpeakTimestamp,
|
|
953
1007
|
},
|
|
@@ -981,8 +1035,8 @@ class Client extends node_events_1.default {
|
|
|
981
1035
|
return transformers_1.Applications.applicationFromRaw(response);
|
|
982
1036
|
}
|
|
983
1037
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
|
|
984
|
-
async editGlobalApplicationCommand(
|
|
985
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationCommand(
|
|
1038
|
+
async editGlobalApplicationCommand(applicationId, commandId, options) {
|
|
1039
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationCommand(applicationId, commandId), {
|
|
986
1040
|
json: {
|
|
987
1041
|
name: options.name,
|
|
988
1042
|
name_localizations: options.nameLocalizations,
|
|
@@ -998,36 +1052,36 @@ class Client extends node_events_1.default {
|
|
|
998
1052
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
999
1053
|
}
|
|
1000
1054
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
|
1001
|
-
async editGuild(
|
|
1002
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guild(
|
|
1055
|
+
async editGuild(guildId, options, reason) {
|
|
1056
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guild(guildId), {
|
|
1003
1057
|
json: {
|
|
1004
1058
|
name: options.name,
|
|
1005
1059
|
verification_level: options.verificationLevel,
|
|
1006
1060
|
default_message_notifications: options.defaultMessageNotifications,
|
|
1007
1061
|
explicit_content_filter: options.explicitContentFilter,
|
|
1008
|
-
afk_channel_id: options.
|
|
1062
|
+
afk_channel_id: options.afkChannelId,
|
|
1009
1063
|
afk_timeout: options.afkTimeout,
|
|
1010
1064
|
icon: options.icon,
|
|
1011
1065
|
splash: options.splash,
|
|
1012
1066
|
discovery_splash: options.discoverySplash,
|
|
1013
1067
|
banner: options.banner,
|
|
1014
|
-
system_channel_id: options.
|
|
1068
|
+
system_channel_id: options.systemChannelId,
|
|
1015
1069
|
system_channel_flags: options.systemChannelFlags,
|
|
1016
|
-
rules_channel_id: options.
|
|
1017
|
-
public_updates_channel_id: options.
|
|
1070
|
+
rules_channel_id: options.rulesChannelId,
|
|
1071
|
+
public_updates_channel_id: options.publicUpdatesChannelId,
|
|
1018
1072
|
preferred_locale: options.preferredLocale,
|
|
1019
1073
|
features: options.features,
|
|
1020
1074
|
description: options.description,
|
|
1021
1075
|
premium_progress_bar_enabled: options.premiumProgressBarEnabled,
|
|
1022
|
-
safety_alerts_channel_id: options.
|
|
1076
|
+
safety_alerts_channel_id: options.safetyAlertsChannelId,
|
|
1023
1077
|
},
|
|
1024
1078
|
reason,
|
|
1025
1079
|
});
|
|
1026
1080
|
return transformers_1.Guilds.guildFromRaw(response);
|
|
1027
1081
|
}
|
|
1028
1082
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
|
|
1029
|
-
async editGuildApplicationCommand(
|
|
1030
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationGuildCommand(
|
|
1083
|
+
async editGuildApplicationCommand(applicationId, guildId, commandId, options) {
|
|
1084
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationGuildCommand(applicationId, guildId, commandId), {
|
|
1031
1085
|
json: {
|
|
1032
1086
|
name: options.name,
|
|
1033
1087
|
name_localizations: options.nameLocalizations,
|
|
@@ -1041,8 +1095,8 @@ class Client extends node_events_1.default {
|
|
|
1041
1095
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
1042
1096
|
}
|
|
1043
1097
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
|
|
1044
|
-
async editGuildEmoji(
|
|
1045
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildEmoji(
|
|
1098
|
+
async editGuildEmoji(guildId, emojiId, options, reason) {
|
|
1099
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildEmoji(guildId, emojiId), {
|
|
1046
1100
|
json: {
|
|
1047
1101
|
name: options.name,
|
|
1048
1102
|
roles: options.roles,
|
|
@@ -1052,8 +1106,8 @@ class Client extends node_events_1.default {
|
|
|
1052
1106
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
1053
1107
|
}
|
|
1054
1108
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-incidents-actions */
|
|
1055
|
-
async editGuildIncidentsActions(
|
|
1056
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildIncidentsActions(
|
|
1109
|
+
async editGuildIncidentsActions(guildId, options, reason) {
|
|
1110
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildIncidentsActions(guildId), {
|
|
1057
1111
|
json: {
|
|
1058
1112
|
invites_disabled_until: options?.invitesDisabledUntil,
|
|
1059
1113
|
dms_disabled_until: options?.dmsDisabledUntil,
|
|
@@ -1068,14 +1122,14 @@ class Client extends node_events_1.default {
|
|
|
1068
1122
|
};
|
|
1069
1123
|
}
|
|
1070
1124
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
|
|
1071
|
-
async editGuildMember(
|
|
1072
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(
|
|
1125
|
+
async editGuildMember(guildId, userId, options, reason) {
|
|
1126
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(guildId, userId), {
|
|
1073
1127
|
json: {
|
|
1074
1128
|
nick: options.nick,
|
|
1075
1129
|
roles: options.roles,
|
|
1076
1130
|
mute: options.mute,
|
|
1077
1131
|
deaf: options.deaf,
|
|
1078
|
-
channel_id: options.
|
|
1132
|
+
channel_id: options.channelId,
|
|
1079
1133
|
communication_disabled_until: options.communicationDisabledUntil,
|
|
1080
1134
|
flags: options.flags,
|
|
1081
1135
|
},
|
|
@@ -1084,20 +1138,20 @@ class Client extends node_events_1.default {
|
|
|
1084
1138
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
1085
1139
|
}
|
|
1086
1140
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
|
|
1087
|
-
editGuildOnboarding(
|
|
1088
|
-
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildOnboarding(
|
|
1141
|
+
editGuildOnboarding(guildId, options, reason) {
|
|
1142
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildOnboarding(guildId), {
|
|
1089
1143
|
json: {
|
|
1090
1144
|
prompts: options.prompts?.map((prompt) => ({
|
|
1091
1145
|
id: prompt.id,
|
|
1092
1146
|
type: prompt.type,
|
|
1093
1147
|
options: prompt.options.map((promptOption) => ({
|
|
1094
1148
|
id: promptOption.id,
|
|
1095
|
-
channel_ids: promptOption.
|
|
1096
|
-
role_ids: promptOption.
|
|
1149
|
+
channel_ids: promptOption.channelIds,
|
|
1150
|
+
role_ids: promptOption.roleIds,
|
|
1097
1151
|
emoji: promptOption.emoji !== undefined
|
|
1098
1152
|
? transformers_1.Emojis.emojiToRaw(promptOption.emoji)
|
|
1099
1153
|
: undefined,
|
|
1100
|
-
emoji_id: promptOption.
|
|
1154
|
+
emoji_id: promptOption.emojiId,
|
|
1101
1155
|
emoji_name: promptOption.emojiName,
|
|
1102
1156
|
emoji_animated: promptOption.emojiAnimated,
|
|
1103
1157
|
title: promptOption.title,
|
|
@@ -1113,12 +1167,17 @@ class Client extends node_events_1.default {
|
|
|
1113
1167
|
});
|
|
1114
1168
|
}
|
|
1115
1169
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role */
|
|
1116
|
-
async editGuildRole(
|
|
1117
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRole(
|
|
1170
|
+
async editGuildRole(guildId, roleId, options, reason) {
|
|
1171
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRole(guildId, roleId), {
|
|
1118
1172
|
json: {
|
|
1119
1173
|
name: options?.name,
|
|
1120
1174
|
permissions: options?.permissions,
|
|
1121
1175
|
color: options?.color,
|
|
1176
|
+
colors: {
|
|
1177
|
+
primary_color: options?.colors?.primaryColor,
|
|
1178
|
+
secondary_color: options?.colors?.secondaryColor,
|
|
1179
|
+
tertiary_color: options?.colors?.tertiaryColor,
|
|
1180
|
+
},
|
|
1122
1181
|
hoist: options?.hoist,
|
|
1123
1182
|
icon: options?.icon,
|
|
1124
1183
|
unicode_emoji: options?.unicodeEmoji,
|
|
@@ -1129,18 +1188,18 @@ class Client extends node_events_1.default {
|
|
|
1129
1188
|
return transformers_1.Roles.roleFromRaw(response);
|
|
1130
1189
|
}
|
|
1131
1190
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
|
|
1132
|
-
async editGuildRolePositions(
|
|
1133
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRoles(
|
|
1191
|
+
async editGuildRolePositions(guildId, options, reason) {
|
|
1192
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRoles(guildId), {
|
|
1134
1193
|
json: options,
|
|
1135
1194
|
reason,
|
|
1136
1195
|
});
|
|
1137
1196
|
return response.map((role) => transformers_1.Roles.roleFromRaw(role));
|
|
1138
1197
|
}
|
|
1139
1198
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
|
|
1140
|
-
async editGuildScheduledEvent(
|
|
1141
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildScheduledEvent(
|
|
1199
|
+
async editGuildScheduledEvent(guildId, guildScheduledEventId, options, reason) {
|
|
1200
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildScheduledEvent(guildId, guildScheduledEventId), {
|
|
1142
1201
|
json: {
|
|
1143
|
-
channel_id: options.
|
|
1202
|
+
channel_id: options.channelId,
|
|
1144
1203
|
entity_metadata: options.entityMetadata,
|
|
1145
1204
|
name: options.name,
|
|
1146
1205
|
privacy_level: options.privacyLevel,
|
|
@@ -1161,8 +1220,8 @@ class Client extends node_events_1.default {
|
|
|
1161
1220
|
return transformers_1.GuildScheduledEvents.guildScheduledEventFromRaw(response);
|
|
1162
1221
|
}
|
|
1163
1222
|
/** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
|
|
1164
|
-
async editGuildSticker(
|
|
1165
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildSticker(
|
|
1223
|
+
async editGuildSticker(guildId, stickerId, options, reason) {
|
|
1224
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildSticker(guildId, stickerId), {
|
|
1166
1225
|
json: {
|
|
1167
1226
|
name: options.name,
|
|
1168
1227
|
description: options.description,
|
|
@@ -1173,12 +1232,12 @@ class Client extends node_events_1.default {
|
|
|
1173
1232
|
return transformers_1.Stickers.stickerFromRaw(response);
|
|
1174
1233
|
}
|
|
1175
1234
|
/** https://discord.com/developers/docs/resources/soundboard#edit-guild-soundboard-sound */
|
|
1176
|
-
async editGuildSoundboardSound(
|
|
1177
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(
|
|
1235
|
+
async editGuildSoundboardSound(guildId, soundId, options, reason) {
|
|
1236
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildId, soundId), {
|
|
1178
1237
|
json: {
|
|
1179
1238
|
name: options.name,
|
|
1180
1239
|
volume: options.volume,
|
|
1181
|
-
emoji_id: options.
|
|
1240
|
+
emoji_id: options.emojiId,
|
|
1182
1241
|
emoji_name: options.emojiName,
|
|
1183
1242
|
},
|
|
1184
1243
|
reason,
|
|
@@ -1186,8 +1245,8 @@ class Client extends node_events_1.default {
|
|
|
1186
1245
|
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
|
1187
1246
|
}
|
|
1188
1247
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
|
1189
|
-
async editGuildTemplate(
|
|
1190
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildTemplate(
|
|
1248
|
+
async editGuildTemplate(guildId, code, options) {
|
|
1249
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildTemplate(guildId, code), {
|
|
1191
1250
|
json: {
|
|
1192
1251
|
name: options.name,
|
|
1193
1252
|
description: options.description,
|
|
@@ -1196,14 +1255,14 @@ class Client extends node_events_1.default {
|
|
|
1196
1255
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
1197
1256
|
}
|
|
1198
1257
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
|
|
1199
|
-
async editGuildWelcomeScreen(
|
|
1200
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWelcomeScreen(
|
|
1258
|
+
async editGuildWelcomeScreen(guildId, options, reason) {
|
|
1259
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWelcomeScreen(guildId), {
|
|
1201
1260
|
json: {
|
|
1202
1261
|
enabled: options.enabled,
|
|
1203
1262
|
welcome_channels: options.welcomeChannels?.map((welcomeChannel) => ({
|
|
1204
|
-
channel_id: welcomeChannel.
|
|
1263
|
+
channel_id: welcomeChannel.channelId,
|
|
1205
1264
|
description: welcomeChannel.description,
|
|
1206
|
-
emoji_id: welcomeChannel.
|
|
1265
|
+
emoji_id: welcomeChannel.emojiId,
|
|
1207
1266
|
emoji_name: welcomeChannel.emojiName,
|
|
1208
1267
|
})),
|
|
1209
1268
|
description: options.description,
|
|
@@ -1213,30 +1272,41 @@ class Client extends node_events_1.default {
|
|
|
1213
1272
|
return {
|
|
1214
1273
|
description: response.description,
|
|
1215
1274
|
welcomeChannels: response.welcome_channels.map((welcomeScreenChannel) => ({
|
|
1216
|
-
|
|
1275
|
+
channelId: welcomeScreenChannel.channel_id,
|
|
1217
1276
|
description: welcomeScreenChannel.description,
|
|
1218
|
-
|
|
1277
|
+
emojiId: welcomeScreenChannel.emoji_id,
|
|
1219
1278
|
emojiName: welcomeScreenChannel.emoji_name,
|
|
1220
1279
|
})),
|
|
1221
1280
|
};
|
|
1222
1281
|
}
|
|
1223
1282
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-widget */
|
|
1224
|
-
async editGuildWidget(
|
|
1225
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWidgetSettings(
|
|
1283
|
+
async editGuildWidget(guildId, options, reason) {
|
|
1284
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWidgetSettings(guildId), {
|
|
1226
1285
|
json: {
|
|
1227
1286
|
enabled: options.enabled,
|
|
1228
|
-
channel_id: options.
|
|
1287
|
+
channel_id: options.channelId,
|
|
1229
1288
|
},
|
|
1230
1289
|
reason,
|
|
1231
1290
|
});
|
|
1232
1291
|
return {
|
|
1233
1292
|
enabled: response.enabled,
|
|
1234
|
-
|
|
1293
|
+
channelId: response.channel_id,
|
|
1235
1294
|
};
|
|
1236
1295
|
}
|
|
1296
|
+
/** https://discord.com/developers/docs/resources/lobby#modify-lobby */
|
|
1297
|
+
async editLobby(lobbyId, options) {
|
|
1298
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobby(lobbyId), {
|
|
1299
|
+
json: {
|
|
1300
|
+
metadata: options.metadata,
|
|
1301
|
+
members: options.members,
|
|
1302
|
+
idle_timeout_seconds: options.idleTimeoutSeconds,
|
|
1303
|
+
},
|
|
1304
|
+
});
|
|
1305
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
1306
|
+
}
|
|
1237
1307
|
/** https://discord.com/developers/docs/resources/message#edit-message */
|
|
1238
|
-
async editMessage(
|
|
1239
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channelMessage(
|
|
1308
|
+
async editMessage(channelId, messageId, options) {
|
|
1309
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channelMessage(channelId, messageId), {
|
|
1240
1310
|
json: {
|
|
1241
1311
|
content: options.content,
|
|
1242
1312
|
embeds: options.embeds !== null
|
|
@@ -1265,8 +1335,8 @@ class Client extends node_events_1.default {
|
|
|
1265
1335
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1266
1336
|
}
|
|
1267
1337
|
/** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance */
|
|
1268
|
-
async editStageInstance(
|
|
1269
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.stageInstance(
|
|
1338
|
+
async editStageInstance(channelId, options, reason) {
|
|
1339
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.stageInstance(channelId), {
|
|
1270
1340
|
json: {
|
|
1271
1341
|
topic: options.topic,
|
|
1272
1342
|
privacy_level: options.privacyLevel,
|
|
@@ -1276,8 +1346,8 @@ class Client extends node_events_1.default {
|
|
|
1276
1346
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
|
1277
1347
|
}
|
|
1278
1348
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message */
|
|
1279
|
-
async editInteractionFollowupMessage(
|
|
1280
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookMessage(
|
|
1349
|
+
async editInteractionFollowupMessage(applicationId, interactionToken, messageId, options) {
|
|
1350
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookMessage(applicationId, interactionToken, messageId), {
|
|
1281
1351
|
json: {
|
|
1282
1352
|
content: options.content,
|
|
1283
1353
|
embeds: options.embeds !== null
|
|
@@ -1319,7 +1389,7 @@ class Client extends node_events_1.default {
|
|
|
1319
1389
|
? {
|
|
1320
1390
|
question: options.poll.question,
|
|
1321
1391
|
answers: options.poll.answers.map((answer) => ({
|
|
1322
|
-
answer_id: answer.
|
|
1392
|
+
answer_id: answer.answerId,
|
|
1323
1393
|
poll_media: answer.pollMedia,
|
|
1324
1394
|
})),
|
|
1325
1395
|
duration: options.poll.duration,
|
|
@@ -1331,14 +1401,14 @@ class Client extends node_events_1.default {
|
|
|
1331
1401
|
},
|
|
1332
1402
|
files: options.files,
|
|
1333
1403
|
query: {
|
|
1334
|
-
thread_id: options.
|
|
1404
|
+
thread_id: options.threadId,
|
|
1335
1405
|
},
|
|
1336
1406
|
});
|
|
1337
1407
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1338
1408
|
}
|
|
1339
1409
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response */
|
|
1340
|
-
async editInteractionResponse(
|
|
1341
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(
|
|
1410
|
+
async editInteractionResponse(applicationId, interactionToken, options) {
|
|
1411
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(applicationId, interactionToken), {
|
|
1342
1412
|
json: {
|
|
1343
1413
|
content: options.content,
|
|
1344
1414
|
embeds: options.embeds !== null
|
|
@@ -1380,7 +1450,7 @@ class Client extends node_events_1.default {
|
|
|
1380
1450
|
? {
|
|
1381
1451
|
question: options.poll.question,
|
|
1382
1452
|
answers: options.poll.answers.map((answer) => ({
|
|
1383
|
-
answer_id: answer.
|
|
1453
|
+
answer_id: answer.answerId,
|
|
1384
1454
|
poll_media: answer.pollMedia,
|
|
1385
1455
|
})),
|
|
1386
1456
|
duration: options.poll.duration,
|
|
@@ -1392,35 +1462,35 @@ class Client extends node_events_1.default {
|
|
|
1392
1462
|
},
|
|
1393
1463
|
files: options.files,
|
|
1394
1464
|
query: {
|
|
1395
|
-
thread_id: options.
|
|
1465
|
+
thread_id: options.threadId,
|
|
1396
1466
|
},
|
|
1397
1467
|
});
|
|
1398
1468
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1399
1469
|
}
|
|
1400
1470
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
|
1401
|
-
editUserVoiceState(
|
|
1402
|
-
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(
|
|
1471
|
+
editUserVoiceState(guildId, userId, options) {
|
|
1472
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(guildId, userId), {
|
|
1403
1473
|
json: {
|
|
1404
|
-
channel_id: options.
|
|
1474
|
+
channel_id: options.channelId,
|
|
1405
1475
|
suppress: options.suppress,
|
|
1406
1476
|
},
|
|
1407
1477
|
});
|
|
1408
1478
|
}
|
|
1409
1479
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook */
|
|
1410
|
-
async editWebhook(
|
|
1411
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(
|
|
1480
|
+
async editWebhook(webhookId, options, reason) {
|
|
1481
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(webhookId), {
|
|
1412
1482
|
json: {
|
|
1413
1483
|
name: options.name,
|
|
1414
1484
|
avatar: options.avatar,
|
|
1415
|
-
channel_id: options.
|
|
1485
|
+
channel_id: options.channelId,
|
|
1416
1486
|
},
|
|
1417
1487
|
reason,
|
|
1418
1488
|
});
|
|
1419
1489
|
return transformers_1.Webhooks.webhookFromRaw(response);
|
|
1420
1490
|
}
|
|
1421
1491
|
/** https://discord.com/developers/docs/resources/webhook#edit-webhook-message */
|
|
1422
|
-
async editWebhookMessage(
|
|
1423
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(
|
|
1492
|
+
async editWebhookMessage(webhookId, webhookToken, messageId, options) {
|
|
1493
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(webhookId, webhookToken, messageId), {
|
|
1424
1494
|
json: {
|
|
1425
1495
|
content: options.content,
|
|
1426
1496
|
embeds: options.embeds !== null
|
|
@@ -1462,7 +1532,7 @@ class Client extends node_events_1.default {
|
|
|
1462
1532
|
? {
|
|
1463
1533
|
question: options.poll.question,
|
|
1464
1534
|
answers: options.poll.answers.map((answer) => ({
|
|
1465
|
-
answer_id: answer.
|
|
1535
|
+
answer_id: answer.answerId,
|
|
1466
1536
|
poll_media: answer.pollMedia,
|
|
1467
1537
|
})),
|
|
1468
1538
|
duration: options.poll.duration,
|
|
@@ -1474,15 +1544,15 @@ class Client extends node_events_1.default {
|
|
|
1474
1544
|
},
|
|
1475
1545
|
files: options.files,
|
|
1476
1546
|
query: {
|
|
1477
|
-
thread_id: options.
|
|
1547
|
+
thread_id: options.threadId,
|
|
1478
1548
|
with_components: options.withComponents,
|
|
1479
1549
|
},
|
|
1480
1550
|
});
|
|
1481
1551
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1482
1552
|
}
|
|
1483
1553
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
|
1484
|
-
async editWebhookWithToken(
|
|
1485
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(
|
|
1554
|
+
async editWebhookWithToken(webhookId, webhookToken, options, reason) {
|
|
1555
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(webhookId, webhookToken), {
|
|
1486
1556
|
json: {
|
|
1487
1557
|
name: options.name,
|
|
1488
1558
|
avatar: options.avatar,
|
|
@@ -1493,13 +1563,13 @@ class Client extends node_events_1.default {
|
|
|
1493
1563
|
return transformers_1.Webhooks.webhookFromRaw(response);
|
|
1494
1564
|
}
|
|
1495
1565
|
/** https://discord.com/developers/docs/resources/poll#end-poll */
|
|
1496
|
-
async endPoll(
|
|
1497
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(
|
|
1566
|
+
async endPoll(channelId, messageId) {
|
|
1567
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelId, messageId));
|
|
1498
1568
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1499
1569
|
}
|
|
1500
1570
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
|
1501
|
-
async executeWebhook(
|
|
1502
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(
|
|
1571
|
+
async executeWebhook(webhookId, webhookToken, options) {
|
|
1572
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(webhookId, webhookToken), {
|
|
1503
1573
|
json: {
|
|
1504
1574
|
content: options.content,
|
|
1505
1575
|
username: options.username,
|
|
@@ -1525,7 +1595,7 @@ class Client extends node_events_1.default {
|
|
|
1525
1595
|
? {
|
|
1526
1596
|
question: options.poll.question,
|
|
1527
1597
|
answers: options.poll.answers.map((answer) => ({
|
|
1528
|
-
answer_id: answer.
|
|
1598
|
+
answer_id: answer.answerId,
|
|
1529
1599
|
poll_media: answer.pollMedia,
|
|
1530
1600
|
})),
|
|
1531
1601
|
duration: options.poll.duration,
|
|
@@ -1537,7 +1607,7 @@ class Client extends node_events_1.default {
|
|
|
1537
1607
|
files: options.files,
|
|
1538
1608
|
query: {
|
|
1539
1609
|
wait: options.wait,
|
|
1540
|
-
thread_id: options.
|
|
1610
|
+
thread_id: options.threadId,
|
|
1541
1611
|
with_components: options.withComponents,
|
|
1542
1612
|
},
|
|
1543
1613
|
});
|
|
@@ -1548,10 +1618,10 @@ class Client extends node_events_1.default {
|
|
|
1548
1618
|
*
|
|
1549
1619
|
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
|
|
1550
1620
|
*/
|
|
1551
|
-
async executeWebhookPlatform(
|
|
1552
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookPlatform(
|
|
1621
|
+
async executeWebhookPlatform(webhookId, webhookToken, platform, options) {
|
|
1622
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookPlatform(webhookId, webhookToken, platform), {
|
|
1553
1623
|
query: {
|
|
1554
|
-
thread_id: options.
|
|
1624
|
+
thread_id: options.threadId,
|
|
1555
1625
|
wait: options.wait,
|
|
1556
1626
|
},
|
|
1557
1627
|
json: options,
|
|
@@ -1559,29 +1629,29 @@ class Client extends node_events_1.default {
|
|
|
1559
1629
|
return response !== null ? transformers_1.Messages.messageFromRaw(response) : null;
|
|
1560
1630
|
}
|
|
1561
1631
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
|
1562
|
-
async followChannel(
|
|
1563
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelFollowers(
|
|
1632
|
+
async followChannel(channelId, options, reason) {
|
|
1633
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelFollowers(channelId), {
|
|
1564
1634
|
json: {
|
|
1565
|
-
webhook_channel_id: options.
|
|
1635
|
+
webhook_channel_id: options.webhookChannelId,
|
|
1566
1636
|
},
|
|
1567
1637
|
reason,
|
|
1568
1638
|
});
|
|
1569
1639
|
return {
|
|
1570
|
-
|
|
1571
|
-
|
|
1640
|
+
channelId: response.channel_id,
|
|
1641
|
+
webhookId: response.webhook_id,
|
|
1572
1642
|
};
|
|
1573
1643
|
}
|
|
1574
1644
|
/** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
|
|
1575
|
-
async getActiveGuildThreads(
|
|
1576
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildActiveThreads(
|
|
1645
|
+
async getActiveGuildThreads(guildId) {
|
|
1646
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildActiveThreads(guildId));
|
|
1577
1647
|
return {
|
|
1578
1648
|
threads: response.threads.map((thread) => transformers_1.Channels.channelFromRaw(thread)),
|
|
1579
1649
|
members: response.members.map((threadMember) => transformers_1.Channels.threadMemberFromRaw(threadMember)),
|
|
1580
1650
|
};
|
|
1581
1651
|
}
|
|
1582
1652
|
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
|
|
1583
|
-
async getArchivedThreads(
|
|
1584
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(
|
|
1653
|
+
async getArchivedThreads(channelId, archivedStatus, options) {
|
|
1654
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(channelId, archivedStatus, false), {
|
|
1585
1655
|
query: {
|
|
1586
1656
|
before: options?.before,
|
|
1587
1657
|
limit: options?.limit,
|
|
@@ -1594,10 +1664,10 @@ class Client extends node_events_1.default {
|
|
|
1594
1664
|
};
|
|
1595
1665
|
}
|
|
1596
1666
|
/** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */
|
|
1597
|
-
async getAuditLog(
|
|
1598
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAuditLog(
|
|
1667
|
+
async getAuditLog(guildId, options) {
|
|
1668
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAuditLog(guildId), {
|
|
1599
1669
|
query: {
|
|
1600
|
-
user_id: options?.
|
|
1670
|
+
user_id: options?.userId,
|
|
1601
1671
|
action_type: options?.actionType,
|
|
1602
1672
|
before: options?.before,
|
|
1603
1673
|
after: options?.after,
|
|
@@ -1607,71 +1677,71 @@ class Client extends node_events_1.default {
|
|
|
1607
1677
|
return transformers_1.AuditLogs.auditLogFromRaw(response);
|
|
1608
1678
|
}
|
|
1609
1679
|
/** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
|
|
1610
|
-
async getAutoModerationRule(
|
|
1611
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRule(
|
|
1680
|
+
async getAutoModerationRule(guildId, ruleId) {
|
|
1681
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRule(guildId, ruleId));
|
|
1612
1682
|
return transformers_1.AutoModeration.autoModerationRuleFromRaw(response);
|
|
1613
1683
|
}
|
|
1614
1684
|
/** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
|
|
1615
|
-
async getAutoModerationRules(
|
|
1616
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRules(
|
|
1685
|
+
async getAutoModerationRules(guildId) {
|
|
1686
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRules(guildId));
|
|
1617
1687
|
return response.map((autoModerationRule) => transformers_1.AutoModeration.autoModerationRuleFromRaw(autoModerationRule));
|
|
1618
1688
|
}
|
|
1619
1689
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-activity-instance */
|
|
1620
|
-
async getApplicationActivityInstance(
|
|
1621
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationActivityInstance(
|
|
1690
|
+
async getApplicationActivityInstance(applicationId, instanceId) {
|
|
1691
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationActivityInstance(applicationId, instanceId));
|
|
1622
1692
|
return {
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1693
|
+
applicationId: response.application_id,
|
|
1694
|
+
instanceId: response.instance_id,
|
|
1695
|
+
launchId: response.launch_id,
|
|
1626
1696
|
location: {
|
|
1627
1697
|
id: response.location.id,
|
|
1628
1698
|
kind: response.location.kind,
|
|
1629
|
-
|
|
1630
|
-
|
|
1699
|
+
channelId: response.location.channel_id,
|
|
1700
|
+
guildId: response.location.guild_id,
|
|
1631
1701
|
},
|
|
1632
1702
|
users: response.users,
|
|
1633
1703
|
};
|
|
1634
1704
|
}
|
|
1635
1705
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
|
1636
|
-
async getApplicationCommandPermissions(
|
|
1637
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommandPermissions(
|
|
1706
|
+
async getApplicationCommandPermissions(applicationId, guildId, commandId) {
|
|
1707
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommandPermissions(applicationId, guildId, commandId));
|
|
1638
1708
|
return transformers_1.Guilds.guildApplicationCommandPermissionsFromRaw(response);
|
|
1639
1709
|
}
|
|
1640
1710
|
/** https://discord.com/developers/docs/resources/emoji#get-application-emoji */
|
|
1641
|
-
async getApplicationEmoji(
|
|
1642
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEmoji(
|
|
1711
|
+
async getApplicationEmoji(applicationId, emojiId) {
|
|
1712
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEmoji(applicationId, emojiId));
|
|
1643
1713
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
1644
1714
|
}
|
|
1645
1715
|
/** https://discord.com/developers/docs/resources/emoji#list-application-emojis */
|
|
1646
|
-
async getApplicationEmojis(
|
|
1647
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEmojis(
|
|
1716
|
+
async getApplicationEmojis(applicationId) {
|
|
1717
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEmojis(applicationId));
|
|
1648
1718
|
return {
|
|
1649
1719
|
items: response.items.map((emoji) => transformers_1.Emojis.emojiFromRaw(emoji)),
|
|
1650
1720
|
};
|
|
1651
1721
|
}
|
|
1652
1722
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
|
|
1653
|
-
async getApplicationRoleConnectionMetadataRecords(
|
|
1654
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationRoleConnectionMetadata(
|
|
1723
|
+
async getApplicationRoleConnectionMetadataRecords(applicationId) {
|
|
1724
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationId));
|
|
1655
1725
|
return response.map((applicationRoleConnectionMetadata) => transformers_1.ApplicationRoleConnectionMetadatas.applicationRoleConnectionMetadataFromRaw(applicationRoleConnectionMetadata));
|
|
1656
1726
|
}
|
|
1657
1727
|
/** https://discord.com/developers/docs/resources/channel#get-channel */
|
|
1658
|
-
async getChannel(
|
|
1659
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channel(
|
|
1728
|
+
async getChannel(channelId) {
|
|
1729
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channel(channelId));
|
|
1660
1730
|
return transformers_1.Channels.channelFromRaw(response);
|
|
1661
1731
|
}
|
|
1662
1732
|
/** https://discord.com/developers/docs/resources/guild#get-guild-channels */
|
|
1663
|
-
async getChannels(
|
|
1664
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildChannels(
|
|
1733
|
+
async getChannels(guildId) {
|
|
1734
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildChannels(guildId));
|
|
1665
1735
|
return response.map((channel) => transformers_1.Channels.channelFromRaw(channel));
|
|
1666
1736
|
}
|
|
1667
1737
|
/** https://discord.com/developers/docs/resources/channel#get-channel-invites */
|
|
1668
|
-
async getChannelInvites(
|
|
1669
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelInvites(
|
|
1738
|
+
async getChannelInvites(channelId) {
|
|
1739
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelInvites(channelId));
|
|
1670
1740
|
return response.map((invite) => transformers_1.Invites.inviteFromRaw(invite));
|
|
1671
1741
|
}
|
|
1672
1742
|
/** https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */
|
|
1673
|
-
async getChannelWebhooks(
|
|
1674
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelWebhooks(
|
|
1743
|
+
async getChannelWebhooks(channelId) {
|
|
1744
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelWebhooks(channelId));
|
|
1675
1745
|
return response.map((webhook) => transformers_1.Webhooks.webhookFromRaw(webhook));
|
|
1676
1746
|
}
|
|
1677
1747
|
/** https://discord.com/developers/docs/resources/application#get-current-application */
|
|
@@ -1680,8 +1750,8 @@ class Client extends node_events_1.default {
|
|
|
1680
1750
|
return transformers_1.Applications.applicationFromRaw(response);
|
|
1681
1751
|
}
|
|
1682
1752
|
/** https://discord.com/developers/docs/resources/user#get-current-user-application-role-connection */
|
|
1683
|
-
async getCurrentApplicationRoleConnection(
|
|
1684
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userApplicationRoleConnection(
|
|
1753
|
+
async getCurrentApplicationRoleConnection(applicationId) {
|
|
1754
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userApplicationRoleConnection(applicationId));
|
|
1685
1755
|
return {
|
|
1686
1756
|
platformName: response.platform_name,
|
|
1687
1757
|
platformUsername: response.platform_username,
|
|
@@ -1689,8 +1759,8 @@ class Client extends node_events_1.default {
|
|
|
1689
1759
|
};
|
|
1690
1760
|
}
|
|
1691
1761
|
/** https://discord.com/developers/docs/resources/user#get-current-user-guild-member */
|
|
1692
|
-
async getCurrentGuildMember(
|
|
1693
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(
|
|
1762
|
+
async getCurrentGuildMember(guildId) {
|
|
1763
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(guildId));
|
|
1694
1764
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
1695
1765
|
}
|
|
1696
1766
|
/** https://discord.com/developers/docs/resources/user#get-current-user-connections */
|
|
@@ -1710,8 +1780,8 @@ class Client extends node_events_1.default {
|
|
|
1710
1780
|
}));
|
|
1711
1781
|
}
|
|
1712
1782
|
/** https://discord.com/developers/docs/resources/voice#get-current-user-voice-state */
|
|
1713
|
-
async getCurrentUserVoiceState(
|
|
1714
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceState(
|
|
1783
|
+
async getCurrentUserVoiceState(guildId) {
|
|
1784
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceState(guildId));
|
|
1715
1785
|
return transformers_1.Voice.voiceStateFromRaw(response);
|
|
1716
1786
|
}
|
|
1717
1787
|
/** https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds */
|
|
@@ -1720,20 +1790,20 @@ class Client extends node_events_1.default {
|
|
|
1720
1790
|
return response.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound));
|
|
1721
1791
|
}
|
|
1722
1792
|
/** https://discord.com/developers/docs/resources/entitlement#get-entitlement */
|
|
1723
|
-
async getEntitlement(
|
|
1724
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlement(
|
|
1793
|
+
async getEntitlement(applicationId, entitlementId) {
|
|
1794
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlement(applicationId, entitlementId));
|
|
1725
1795
|
return transformers_1.Entitlements.entitlementFromRaw(response);
|
|
1726
1796
|
}
|
|
1727
1797
|
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
|
1728
|
-
async getEntitlements(
|
|
1729
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(
|
|
1798
|
+
async getEntitlements(applicationId, options) {
|
|
1799
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationId), {
|
|
1730
1800
|
query: {
|
|
1731
|
-
user_id: options?.
|
|
1732
|
-
sku_ids: options?.
|
|
1801
|
+
user_id: options?.userId,
|
|
1802
|
+
sku_ids: options?.skuIds,
|
|
1733
1803
|
before: options?.before,
|
|
1734
1804
|
after: options?.after,
|
|
1735
1805
|
limit: options?.limit,
|
|
1736
|
-
guild_id: options?.
|
|
1806
|
+
guild_id: options?.guildId,
|
|
1737
1807
|
exclude_ended: options?.excludeEnded,
|
|
1738
1808
|
exclude_deleted: options?.excludeDeleted,
|
|
1739
1809
|
},
|
|
@@ -1759,13 +1829,13 @@ class Client extends node_events_1.default {
|
|
|
1759
1829
|
};
|
|
1760
1830
|
}
|
|
1761
1831
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
|
|
1762
|
-
async getGlobalApplicationCommand(
|
|
1763
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommand(
|
|
1832
|
+
async getGlobalApplicationCommand(applicationId, commandId) {
|
|
1833
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommand(applicationId, commandId));
|
|
1764
1834
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
1765
1835
|
}
|
|
1766
1836
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
|
|
1767
|
-
async getGlobalApplicationCommands(
|
|
1768
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommands(
|
|
1837
|
+
async getGlobalApplicationCommands(applicationId, options) {
|
|
1838
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommands(applicationId), {
|
|
1769
1839
|
query: {
|
|
1770
1840
|
with_localizations: options.withLocalizations,
|
|
1771
1841
|
},
|
|
@@ -1773,8 +1843,8 @@ class Client extends node_events_1.default {
|
|
|
1773
1843
|
return response.map((applicationCommand) => transformers_1.ApplicationCommands.applicationCommandFromRaw(applicationCommand));
|
|
1774
1844
|
}
|
|
1775
1845
|
/** https://discord.com/developers/docs/resources/guild#get-guild */
|
|
1776
|
-
async getGuild(
|
|
1777
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guild(
|
|
1846
|
+
async getGuild(guildId, options) {
|
|
1847
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guild(guildId), {
|
|
1778
1848
|
query: {
|
|
1779
1849
|
with_counts: options?.withCounts,
|
|
1780
1850
|
},
|
|
@@ -1804,13 +1874,13 @@ class Client extends node_events_1.default {
|
|
|
1804
1874
|
}));
|
|
1805
1875
|
}
|
|
1806
1876
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
|
|
1807
|
-
async getGuildApplicationCommand(
|
|
1808
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommand(
|
|
1877
|
+
async getGuildApplicationCommand(applicationId, guildId, commandId) {
|
|
1878
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommand(applicationId, guildId, commandId));
|
|
1809
1879
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
1810
1880
|
}
|
|
1811
1881
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
|
|
1812
|
-
async getGuildApplicationCommands(
|
|
1813
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommands(
|
|
1882
|
+
async getGuildApplicationCommands(applicationId, guildId, options) {
|
|
1883
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommands(applicationId, guildId), {
|
|
1814
1884
|
query: {
|
|
1815
1885
|
with_localizations: options?.withLocalizations,
|
|
1816
1886
|
},
|
|
@@ -1818,21 +1888,21 @@ class Client extends node_events_1.default {
|
|
|
1818
1888
|
return response.map((applicationCommand) => transformers_1.ApplicationCommands.applicationCommandFromRaw(applicationCommand));
|
|
1819
1889
|
}
|
|
1820
1890
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
|
|
1821
|
-
async getGuildApplicationCommandPermissions(
|
|
1822
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildApplicationCommandsPermissions(
|
|
1891
|
+
async getGuildApplicationCommandPermissions(applicationId, guildId) {
|
|
1892
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildApplicationCommandsPermissions(applicationId, guildId));
|
|
1823
1893
|
return transformers_1.Guilds.guildApplicationCommandPermissionsFromRaw(response);
|
|
1824
1894
|
}
|
|
1825
1895
|
/** https://discord.com/developers/docs/resources/guild#get-guild-ban */
|
|
1826
|
-
async getGuildBan(
|
|
1827
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBan(
|
|
1896
|
+
async getGuildBan(guildId, userId) {
|
|
1897
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBan(guildId, userId));
|
|
1828
1898
|
return {
|
|
1829
1899
|
reason: response.reason,
|
|
1830
1900
|
user: transformers_1.Users.userFromRaw(response.user),
|
|
1831
1901
|
};
|
|
1832
1902
|
}
|
|
1833
1903
|
/** https://discord.com/developers/docs/resources/guild#get-guild-bans */
|
|
1834
|
-
async getGuildBans(
|
|
1835
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBans(
|
|
1904
|
+
async getGuildBans(guildId, options) {
|
|
1905
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBans(guildId), {
|
|
1836
1906
|
query: {
|
|
1837
1907
|
limit: options?.limit,
|
|
1838
1908
|
before: options?.before,
|
|
@@ -1845,33 +1915,33 @@ class Client extends node_events_1.default {
|
|
|
1845
1915
|
}));
|
|
1846
1916
|
}
|
|
1847
1917
|
/** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
|
|
1848
|
-
async getGuildEmoji(
|
|
1849
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmoji(
|
|
1918
|
+
async getGuildEmoji(guildId, emojiId) {
|
|
1919
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmoji(guildId, emojiId));
|
|
1850
1920
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
1851
1921
|
}
|
|
1852
1922
|
/** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
|
|
1853
|
-
async getGuildEmojis(
|
|
1854
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmojis(
|
|
1923
|
+
async getGuildEmojis(guildId) {
|
|
1924
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmojis(guildId));
|
|
1855
1925
|
return response.map((emoji) => transformers_1.Emojis.emojiFromRaw(emoji));
|
|
1856
1926
|
}
|
|
1857
1927
|
/** https://discord.com/developers/docs/resources/guild#get-guild-integrations */
|
|
1858
|
-
async getGuildIntegrations(
|
|
1859
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildIntegrations(
|
|
1928
|
+
async getGuildIntegrations(guildId) {
|
|
1929
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildIntegrations(guildId));
|
|
1860
1930
|
return response.map((integration) => transformers_1.Guilds.integrationFromRaw(integration));
|
|
1861
1931
|
}
|
|
1862
1932
|
/** https://discord.com/developers/docs/resources/guild#get-guild-invites */
|
|
1863
|
-
async getGuildInvites(
|
|
1864
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildInvites(
|
|
1933
|
+
async getGuildInvites(guildId) {
|
|
1934
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildInvites(guildId));
|
|
1865
1935
|
return response.map((invite) => transformers_1.Invites.inviteFromRaw(invite));
|
|
1866
1936
|
}
|
|
1867
1937
|
/** https://discord.com/developers/docs/resources/guild#get-guild-member */
|
|
1868
|
-
async getGuildMember(
|
|
1869
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(
|
|
1938
|
+
async getGuildMember(guildId, userId) {
|
|
1939
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(guildId, userId));
|
|
1870
1940
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
1871
1941
|
}
|
|
1872
1942
|
/** https://discord.com/developers/docs/resources/guild#list-guild-members */
|
|
1873
|
-
async getGuildMembers(
|
|
1874
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembers(
|
|
1943
|
+
async getGuildMembers(guildId, options) {
|
|
1944
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembers(guildId), {
|
|
1875
1945
|
query: {
|
|
1876
1946
|
limit: options.limit,
|
|
1877
1947
|
after: options.after,
|
|
@@ -1880,21 +1950,21 @@ class Client extends node_events_1.default {
|
|
|
1880
1950
|
return response.map((guildMember) => transformers_1.Guilds.guildMemberFromRaw(guildMember));
|
|
1881
1951
|
}
|
|
1882
1952
|
/** https://discord.com/developers/docs/resources/guild#get-guild-onboarding */
|
|
1883
|
-
async getGuildOnboarding(
|
|
1884
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildOnboarding(
|
|
1953
|
+
async getGuildOnboarding(guildId) {
|
|
1954
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildOnboarding(guildId));
|
|
1885
1955
|
return {
|
|
1886
|
-
|
|
1956
|
+
guildId: response.guild_id,
|
|
1887
1957
|
prompts: response.prompts.map((prompt) => ({
|
|
1888
1958
|
id: prompt.id,
|
|
1889
1959
|
type: prompt.type,
|
|
1890
1960
|
options: prompt.options.map((promptOption) => ({
|
|
1891
1961
|
id: promptOption.id,
|
|
1892
|
-
|
|
1893
|
-
|
|
1962
|
+
channelIds: promptOption.channel_ids,
|
|
1963
|
+
roleIds: promptOption.role_ids,
|
|
1894
1964
|
emoji: promptOption.emoji !== undefined
|
|
1895
1965
|
? transformers_1.Emojis.emojiFromRaw(promptOption.emoji)
|
|
1896
1966
|
: undefined,
|
|
1897
|
-
|
|
1967
|
+
emojiId: promptOption.emoji_id,
|
|
1898
1968
|
emojiName: promptOption.emoji_name,
|
|
1899
1969
|
emojiAnimated: promptOption.emoji_animated,
|
|
1900
1970
|
title: promptOption.title,
|
|
@@ -1905,14 +1975,14 @@ class Client extends node_events_1.default {
|
|
|
1905
1975
|
required: prompt.required,
|
|
1906
1976
|
inOnboarding: prompt.in_onboarding,
|
|
1907
1977
|
})),
|
|
1908
|
-
|
|
1978
|
+
defaultChannelIds: response.default_channel_ids,
|
|
1909
1979
|
enabled: response.enabled,
|
|
1910
1980
|
mode: response.mode,
|
|
1911
1981
|
};
|
|
1912
1982
|
}
|
|
1913
1983
|
/** https://discord.com/developers/docs/resources/guild#get-guild-preview */
|
|
1914
|
-
async getGuildPreview(
|
|
1915
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPreview(
|
|
1984
|
+
async getGuildPreview(guildId) {
|
|
1985
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPreview(guildId));
|
|
1916
1986
|
return {
|
|
1917
1987
|
id: response.id,
|
|
1918
1988
|
name: response.name,
|
|
@@ -1928,8 +1998,8 @@ class Client extends node_events_1.default {
|
|
|
1928
1998
|
};
|
|
1929
1999
|
}
|
|
1930
2000
|
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
|
|
1931
|
-
getGuildPruneCount(
|
|
1932
|
-
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPrune(
|
|
2001
|
+
getGuildPruneCount(guildId, options) {
|
|
2002
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPrune(guildId), {
|
|
1933
2003
|
query: {
|
|
1934
2004
|
days: options.days,
|
|
1935
2005
|
include_roles: options.includeRoles,
|
|
@@ -1937,18 +2007,18 @@ class Client extends node_events_1.default {
|
|
|
1937
2007
|
});
|
|
1938
2008
|
}
|
|
1939
2009
|
/** https://discord.com/developers/docs/resources/guild#get-guild-role */
|
|
1940
|
-
async getGuildRole(
|
|
1941
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRole(
|
|
2010
|
+
async getGuildRole(guildId, roleId) {
|
|
2011
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRole(guildId, roleId));
|
|
1942
2012
|
return transformers_1.Roles.roleFromRaw(response);
|
|
1943
2013
|
}
|
|
1944
2014
|
/** https://discord.com/developers/docs/resources/guild#get-guild-roles */
|
|
1945
|
-
async getGuildRoles(
|
|
1946
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRoles(
|
|
2015
|
+
async getGuildRoles(guildId) {
|
|
2016
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRoles(guildId));
|
|
1947
2017
|
return response.map((role) => transformers_1.Roles.roleFromRaw(role));
|
|
1948
2018
|
}
|
|
1949
2019
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild */
|
|
1950
|
-
async getGuildScheduledEvents(
|
|
1951
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvents(
|
|
2020
|
+
async getGuildScheduledEvents(guildId, options) {
|
|
2021
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvents(guildId), {
|
|
1952
2022
|
query: {
|
|
1953
2023
|
with_user_count: options?.withUserCount,
|
|
1954
2024
|
},
|
|
@@ -1956,8 +2026,8 @@ class Client extends node_events_1.default {
|
|
|
1956
2026
|
return response.map((guildScheduledEvent) => transformers_1.GuildScheduledEvents.guildScheduledEventFromRaw(guildScheduledEvent));
|
|
1957
2027
|
}
|
|
1958
2028
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users */
|
|
1959
|
-
async getGuildScheduledEventUsers(
|
|
1960
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvent(
|
|
2029
|
+
async getGuildScheduledEventUsers(guildId, guildScheduledEventId, options) {
|
|
2030
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvent(guildId, guildScheduledEventId), {
|
|
1961
2031
|
query: {
|
|
1962
2032
|
limit: options?.limit,
|
|
1963
2033
|
with_member: options?.withMember,
|
|
@@ -1966,7 +2036,7 @@ class Client extends node_events_1.default {
|
|
|
1966
2036
|
},
|
|
1967
2037
|
});
|
|
1968
2038
|
return response.map((guildScheduledEventUser) => ({
|
|
1969
|
-
|
|
2039
|
+
guildScheduledEventId: guildScheduledEventUser.guild_scheduled_event_id,
|
|
1970
2040
|
user: transformers_1.Users.userFromRaw(guildScheduledEventUser.user),
|
|
1971
2041
|
member: guildScheduledEventUser.member !== undefined
|
|
1972
2042
|
? transformers_1.Guilds.guildMemberFromRaw(guildScheduledEventUser.member)
|
|
@@ -1974,43 +2044,43 @@ class Client extends node_events_1.default {
|
|
|
1974
2044
|
}));
|
|
1975
2045
|
}
|
|
1976
2046
|
/** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
|
|
1977
|
-
async getGuildSticker(
|
|
1978
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSticker(
|
|
2047
|
+
async getGuildSticker(guildId, stickerId) {
|
|
2048
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSticker(guildId, stickerId));
|
|
1979
2049
|
return transformers_1.Stickers.stickerFromRaw(response);
|
|
1980
2050
|
}
|
|
1981
2051
|
/** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
|
|
1982
|
-
async getGuildStickers(
|
|
1983
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildStickers(
|
|
2052
|
+
async getGuildStickers(guildId) {
|
|
2053
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildStickers(guildId));
|
|
1984
2054
|
return response.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker));
|
|
1985
2055
|
}
|
|
1986
2056
|
/** https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound */
|
|
1987
|
-
async getGuildSoundboardSound(
|
|
1988
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(
|
|
2057
|
+
async getGuildSoundboardSound(guildId, soundId) {
|
|
2058
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSound(guildId, soundId));
|
|
1989
2059
|
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
|
1990
2060
|
}
|
|
1991
|
-
async getGuildSoundboardSounds(
|
|
1992
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSounds(
|
|
2061
|
+
async getGuildSoundboardSounds(guildId) {
|
|
2062
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSoundboardSounds(guildId));
|
|
1993
2063
|
return {
|
|
1994
2064
|
items: response.items.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)),
|
|
1995
2065
|
};
|
|
1996
2066
|
}
|
|
1997
2067
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
|
1998
|
-
async getGuildTemplate(
|
|
1999
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplate(
|
|
2068
|
+
async getGuildTemplate(guildId, code) {
|
|
2069
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplate(guildId, code));
|
|
2000
2070
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
2001
2071
|
}
|
|
2002
2072
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-templates */
|
|
2003
|
-
async getGuildTemplates(
|
|
2004
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplates(
|
|
2073
|
+
async getGuildTemplates(guildId) {
|
|
2074
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplates(guildId));
|
|
2005
2075
|
return response.map((guildTemplate) => transformers_1.GuildTemplates.guildTemplateFromRaw(guildTemplate));
|
|
2006
2076
|
}
|
|
2007
2077
|
/** https://discord.com/developers/docs/resources/guild#get-guild-vanity-url */
|
|
2008
|
-
getGuildVanityURL(
|
|
2009
|
-
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVanityURL(
|
|
2078
|
+
getGuildVanityURL(guildId) {
|
|
2079
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVanityURL(guildId));
|
|
2010
2080
|
}
|
|
2011
2081
|
/** https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */
|
|
2012
|
-
async getGuildVoiceRegions(
|
|
2013
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceRegions(
|
|
2082
|
+
async getGuildVoiceRegions(guildId) {
|
|
2083
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceRegions(guildId));
|
|
2014
2084
|
return response.map((voiceRegion) => ({
|
|
2015
2085
|
id: voiceRegion.id,
|
|
2016
2086
|
name: voiceRegion.name,
|
|
@@ -2020,21 +2090,21 @@ class Client extends node_events_1.default {
|
|
|
2020
2090
|
}));
|
|
2021
2091
|
}
|
|
2022
2092
|
/** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
|
|
2023
|
-
async getGuildWelcomeScreen(
|
|
2024
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWelcomeScreen(
|
|
2093
|
+
async getGuildWelcomeScreen(guildId) {
|
|
2094
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWelcomeScreen(guildId));
|
|
2025
2095
|
return {
|
|
2026
2096
|
description: response.description,
|
|
2027
2097
|
welcomeChannels: response.welcome_channels.map((welcomeScreenChannel) => ({
|
|
2028
|
-
|
|
2098
|
+
channelId: welcomeScreenChannel.channel_id,
|
|
2029
2099
|
description: welcomeScreenChannel.description,
|
|
2030
|
-
|
|
2100
|
+
emojiId: welcomeScreenChannel.emoji_id,
|
|
2031
2101
|
emojiName: welcomeScreenChannel.emoji_name,
|
|
2032
2102
|
})),
|
|
2033
2103
|
};
|
|
2034
2104
|
}
|
|
2035
2105
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget */
|
|
2036
|
-
async getGuildWidget(
|
|
2037
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetJSON(
|
|
2106
|
+
async getGuildWidget(guildId) {
|
|
2107
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetJSON(guildId));
|
|
2038
2108
|
return {
|
|
2039
2109
|
id: response.id,
|
|
2040
2110
|
name: response.name,
|
|
@@ -2045,35 +2115,35 @@ class Client extends node_events_1.default {
|
|
|
2045
2115
|
};
|
|
2046
2116
|
}
|
|
2047
2117
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
|
|
2048
|
-
getGuildWidgetImage(
|
|
2049
|
-
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetImage(
|
|
2118
|
+
getGuildWidgetImage(guildId, options) {
|
|
2119
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetImage(guildId), {
|
|
2050
2120
|
query: {
|
|
2051
2121
|
style: options?.style,
|
|
2052
2122
|
},
|
|
2053
2123
|
});
|
|
2054
2124
|
}
|
|
2055
2125
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-settings */
|
|
2056
|
-
async getGuildWidgetSettings(
|
|
2057
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetSettings(
|
|
2126
|
+
async getGuildWidgetSettings(guildId) {
|
|
2127
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetSettings(guildId));
|
|
2058
2128
|
return {
|
|
2059
2129
|
enabled: response.enabled,
|
|
2060
|
-
|
|
2130
|
+
channelId: response.channel_id,
|
|
2061
2131
|
};
|
|
2062
2132
|
}
|
|
2063
2133
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message */
|
|
2064
|
-
async getInteractionFollowupMessage(
|
|
2065
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(
|
|
2134
|
+
async getInteractionFollowupMessage(applicationId, interactionToken, messageId, options) {
|
|
2135
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(applicationId, interactionToken, messageId), {
|
|
2066
2136
|
query: {
|
|
2067
|
-
thread_id: options?.
|
|
2137
|
+
thread_id: options?.threadId,
|
|
2068
2138
|
},
|
|
2069
2139
|
});
|
|
2070
2140
|
return transformers_1.Messages.messageFromRaw(response);
|
|
2071
2141
|
}
|
|
2072
2142
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response */
|
|
2073
|
-
async getInteractionResponse(
|
|
2074
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(
|
|
2143
|
+
async getInteractionResponse(applicationId, interactionToken, options) {
|
|
2144
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(applicationId, interactionToken), {
|
|
2075
2145
|
query: {
|
|
2076
|
-
thread_id: options?.
|
|
2146
|
+
thread_id: options?.threadId,
|
|
2077
2147
|
},
|
|
2078
2148
|
});
|
|
2079
2149
|
return transformers_1.Messages.messageFromRaw(response);
|
|
@@ -2083,15 +2153,14 @@ class Client extends node_events_1.default {
|
|
|
2083
2153
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.invite(code), {
|
|
2084
2154
|
query: {
|
|
2085
2155
|
with_counts: options?.withCounts,
|
|
2086
|
-
|
|
2087
|
-
guild_scheduled_event_id: options?.guildScheduledEventID,
|
|
2156
|
+
guild_scheduled_event_id: options?.guildScheduledEventId,
|
|
2088
2157
|
},
|
|
2089
2158
|
});
|
|
2090
2159
|
return transformers_1.Invites.inviteFromRaw(response);
|
|
2091
2160
|
}
|
|
2092
2161
|
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
|
2093
|
-
async getJoinedPrivateArchivedThreads(
|
|
2094
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(
|
|
2162
|
+
async getJoinedPrivateArchivedThreads(channelId, options) {
|
|
2163
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(channelId, "private", true), {
|
|
2095
2164
|
query: {
|
|
2096
2165
|
before: options?.before,
|
|
2097
2166
|
limit: options?.limit,
|
|
@@ -2103,14 +2172,19 @@ class Client extends node_events_1.default {
|
|
|
2103
2172
|
hasMore: response.has_more,
|
|
2104
2173
|
};
|
|
2105
2174
|
}
|
|
2175
|
+
/** https://discord.com/developers/docs/resources/lobby#get-lobby */
|
|
2176
|
+
async getLobby(lobbyId) {
|
|
2177
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(lobbyId));
|
|
2178
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2179
|
+
}
|
|
2106
2180
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
2107
|
-
async getMessage(
|
|
2108
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(
|
|
2181
|
+
async getMessage(channelId, messageId) {
|
|
2182
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelId, messageId));
|
|
2109
2183
|
return transformers_1.Messages.messageFromRaw(response);
|
|
2110
2184
|
}
|
|
2111
2185
|
/** https://discord.com/developers/docs/resources/message#get-reactions */
|
|
2112
|
-
async getMessageReactions(
|
|
2113
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessageAllReactions(
|
|
2186
|
+
async getMessageReactions(channelId, messageId, emoji, options) {
|
|
2187
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessageAllReactions(channelId, messageId, emoji), {
|
|
2114
2188
|
query: {
|
|
2115
2189
|
type: options?.type,
|
|
2116
2190
|
after: options?.after,
|
|
@@ -2120,8 +2194,8 @@ class Client extends node_events_1.default {
|
|
|
2120
2194
|
return response.map((user) => transformers_1.Users.userFromRaw(user));
|
|
2121
2195
|
}
|
|
2122
2196
|
/** https://discord.com/developers/docs/resources/message#get-channel-messages */
|
|
2123
|
-
async getMessages(
|
|
2124
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessages(
|
|
2197
|
+
async getMessages(channelId, options) {
|
|
2198
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessages(channelId), {
|
|
2125
2199
|
query: {
|
|
2126
2200
|
around: options.around,
|
|
2127
2201
|
before: options.before,
|
|
@@ -2149,8 +2223,8 @@ class Client extends node_events_1.default {
|
|
|
2149
2223
|
};
|
|
2150
2224
|
}
|
|
2151
2225
|
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
|
2152
|
-
async getPinnedMessages(
|
|
2153
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(
|
|
2226
|
+
async getPinnedMessages(channelId, options) {
|
|
2227
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelId), {
|
|
2154
2228
|
query: options,
|
|
2155
2229
|
});
|
|
2156
2230
|
return {
|
|
@@ -2162,8 +2236,8 @@ class Client extends node_events_1.default {
|
|
|
2162
2236
|
};
|
|
2163
2237
|
}
|
|
2164
2238
|
/** https://discord.com/developers/docs/resources/poll#get-answer-voters */
|
|
2165
|
-
async getPollAnswerVoters(
|
|
2166
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.pollAnswerVoters(
|
|
2239
|
+
async getPollAnswerVoters(channelId, messageId, answerId, options) {
|
|
2240
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2167
2241
|
query: {
|
|
2168
2242
|
after: options?.after,
|
|
2169
2243
|
limit: options?.limit,
|
|
@@ -2174,43 +2248,43 @@ class Client extends node_events_1.default {
|
|
|
2174
2248
|
};
|
|
2175
2249
|
}
|
|
2176
2250
|
/** https://discord.com/developers/docs/resources/sku#list-skus */
|
|
2177
|
-
async getSKUs(
|
|
2178
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationSKUs(
|
|
2251
|
+
async getSKUs(applicationId) {
|
|
2252
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationSKUs(applicationId));
|
|
2179
2253
|
return response.map((sku) => transformers_1.SKUs.skuFromRaw(sku));
|
|
2180
2254
|
}
|
|
2181
2255
|
/** https://discord.com/developers/docs/resources/subscription#get-sku-subscription */
|
|
2182
|
-
async getSKUSubscription(
|
|
2183
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.skuSubscription(
|
|
2256
|
+
async getSKUSubscription(skuId, subscriptionId) {
|
|
2257
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.skuSubscription(skuId, subscriptionId));
|
|
2184
2258
|
return transformers_1.Subscriptions.subscriptionFromRaw(response);
|
|
2185
2259
|
}
|
|
2186
2260
|
/** https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions */
|
|
2187
|
-
async getSKUSubscriptions(
|
|
2188
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.skuSubscriptions(
|
|
2261
|
+
async getSKUSubscriptions(skuId, options) {
|
|
2262
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.skuSubscriptions(skuId), {
|
|
2189
2263
|
query: {
|
|
2190
2264
|
before: options.before,
|
|
2191
2265
|
after: options.after,
|
|
2192
2266
|
limit: options.limit,
|
|
2193
|
-
user_id: options.
|
|
2267
|
+
user_id: options.userId,
|
|
2194
2268
|
},
|
|
2195
2269
|
});
|
|
2196
2270
|
return response.map((subscription) => transformers_1.Subscriptions.subscriptionFromRaw(subscription));
|
|
2197
2271
|
}
|
|
2198
2272
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
|
2199
|
-
async getStageInstance(
|
|
2200
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stageInstance(
|
|
2273
|
+
async getStageInstance(channelId) {
|
|
2274
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stageInstance(channelId));
|
|
2201
2275
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
|
2202
2276
|
}
|
|
2203
2277
|
/** https://discord.com/developers/docs/resources/sticker#get-sticker-pack */
|
|
2204
|
-
async getStickerPack(
|
|
2205
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stickerPack(
|
|
2278
|
+
async getStickerPack(packId) {
|
|
2279
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stickerPack(packId));
|
|
2206
2280
|
return {
|
|
2207
2281
|
id: response.id,
|
|
2208
2282
|
stickers: response.stickers.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker)),
|
|
2209
2283
|
name: response.name,
|
|
2210
|
-
|
|
2211
|
-
|
|
2284
|
+
skuId: response.sku_id,
|
|
2285
|
+
coverStickerId: response.cover_sticker_id,
|
|
2212
2286
|
description: response.description,
|
|
2213
|
-
|
|
2287
|
+
bannerAssetId: response.banner_asset_id,
|
|
2214
2288
|
};
|
|
2215
2289
|
}
|
|
2216
2290
|
/** https://discord.com/developers/docs/resources/sticker#list-sticker-packs */
|
|
@@ -2221,16 +2295,16 @@ class Client extends node_events_1.default {
|
|
|
2221
2295
|
id: stickerPack.id,
|
|
2222
2296
|
stickers: stickerPack.stickers.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker)),
|
|
2223
2297
|
name: stickerPack.name,
|
|
2224
|
-
|
|
2225
|
-
|
|
2298
|
+
skuId: stickerPack.sku_id,
|
|
2299
|
+
coverStickerId: stickerPack.cover_sticker_id,
|
|
2226
2300
|
description: stickerPack.description,
|
|
2227
|
-
|
|
2301
|
+
bannerAssetId: stickerPack.banner_asset_id,
|
|
2228
2302
|
})),
|
|
2229
2303
|
};
|
|
2230
2304
|
}
|
|
2231
2305
|
/** https://discord.com/developers/docs/resources/channel#get-thread-member */
|
|
2232
|
-
async getThreadMember(
|
|
2233
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(
|
|
2306
|
+
async getThreadMember(channelId, userId, options) {
|
|
2307
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(channelId, userId), {
|
|
2234
2308
|
query: {
|
|
2235
2309
|
with_member: options?.withMember,
|
|
2236
2310
|
},
|
|
@@ -2238,8 +2312,8 @@ class Client extends node_events_1.default {
|
|
|
2238
2312
|
return transformers_1.Channels.threadMemberFromRaw(response);
|
|
2239
2313
|
}
|
|
2240
2314
|
/** https://discord.com/developers/docs/resources/channel#list-thread-members */
|
|
2241
|
-
async getThreadMembers(
|
|
2242
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(
|
|
2315
|
+
async getThreadMembers(channelId, options) {
|
|
2316
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(channelId), {
|
|
2243
2317
|
query: {
|
|
2244
2318
|
with_member: options?.withMember,
|
|
2245
2319
|
after: options?.after,
|
|
@@ -2249,8 +2323,8 @@ class Client extends node_events_1.default {
|
|
|
2249
2323
|
return response.map((threadMember) => transformers_1.Channels.threadMemberFromRaw(threadMember));
|
|
2250
2324
|
}
|
|
2251
2325
|
/** https://discord.com/developers/docs/resources/user#get-user */
|
|
2252
|
-
async getUser(
|
|
2253
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.user(
|
|
2326
|
+
async getUser(userId) {
|
|
2327
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.user(userId));
|
|
2254
2328
|
return transformers_1.Users.userFromRaw(response);
|
|
2255
2329
|
}
|
|
2256
2330
|
/** https://discord.com/developers/docs/resources/voice#list-voice-regions */
|
|
@@ -2265,89 +2339,110 @@ class Client extends node_events_1.default {
|
|
|
2265
2339
|
}));
|
|
2266
2340
|
}
|
|
2267
2341
|
/** https://discord.com/developers/docs/resources/voice#get-user-voice-state */
|
|
2268
|
-
async getUserVoiceState(
|
|
2269
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceState(
|
|
2342
|
+
async getUserVoiceState(guildId, userId) {
|
|
2343
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceState(guildId, userId));
|
|
2270
2344
|
return transformers_1.Voice.voiceStateFromRaw(response);
|
|
2271
2345
|
}
|
|
2272
2346
|
/** https://discord.com/developers/docs/resources/webhook#get-webhook-message */
|
|
2273
|
-
async getWebhookMessage(
|
|
2274
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(
|
|
2347
|
+
async getWebhookMessage(webhookId, webhookToken, messageId, options) {
|
|
2348
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(webhookId, webhookToken, messageId), {
|
|
2275
2349
|
query: {
|
|
2276
|
-
thread_id: options?.
|
|
2350
|
+
thread_id: options?.threadId,
|
|
2277
2351
|
},
|
|
2278
2352
|
});
|
|
2279
2353
|
return transformers_1.Messages.messageFromRaw(response);
|
|
2280
2354
|
}
|
|
2281
2355
|
/** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
|
|
2282
|
-
async getWebhooks(
|
|
2283
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(
|
|
2356
|
+
async getWebhooks(guildId) {
|
|
2357
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(guildId));
|
|
2284
2358
|
return response.map((webhook) => transformers_1.Webhooks.webhookFromRaw(webhook));
|
|
2285
2359
|
}
|
|
2286
2360
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
|
2287
|
-
joinThread(
|
|
2288
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(
|
|
2361
|
+
joinThread(channelId) {
|
|
2362
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelId));
|
|
2289
2363
|
}
|
|
2290
2364
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
2291
|
-
joinVoiceChannel(
|
|
2292
|
-
this.shards
|
|
2293
|
-
|
|
2294
|
-
|
|
2365
|
+
joinVoiceChannel(guildId, channelId, options) {
|
|
2366
|
+
this.shards
|
|
2367
|
+
.get(this.guildShardMap.get(guildId))
|
|
2368
|
+
.transmitter.updateVoiceState({
|
|
2369
|
+
guildId,
|
|
2370
|
+
channelId,
|
|
2295
2371
|
selfMute: !!options?.selfMute,
|
|
2296
2372
|
selfDeaf: !!options?.selfDeaf,
|
|
2297
2373
|
});
|
|
2298
2374
|
}
|
|
2299
2375
|
/** https://discord.com/developers/docs/resources/user#leave-guild */
|
|
2300
|
-
leaveGuild(
|
|
2301
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(
|
|
2376
|
+
leaveGuild(guildId) {
|
|
2377
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(guildId));
|
|
2378
|
+
}
|
|
2379
|
+
/** https://discord.com/developers/docs/resources/lobby#leave-lobby */
|
|
2380
|
+
leaveLobby(lobbyId) {
|
|
2381
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyId));
|
|
2302
2382
|
}
|
|
2303
2383
|
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
|
2304
|
-
leaveThread(
|
|
2305
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(
|
|
2384
|
+
leaveThread(channelId) {
|
|
2385
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelId, "@me"));
|
|
2306
2386
|
}
|
|
2307
2387
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
2308
|
-
leaveVoiceChannel(
|
|
2309
|
-
this.shards
|
|
2310
|
-
|
|
2311
|
-
|
|
2388
|
+
leaveVoiceChannel(guildId) {
|
|
2389
|
+
this.shards
|
|
2390
|
+
.get(this.guildShardMap.get(guildId))
|
|
2391
|
+
.transmitter.updateVoiceState({
|
|
2392
|
+
guildId,
|
|
2393
|
+
channelId: null,
|
|
2312
2394
|
selfMute: false,
|
|
2313
2395
|
selfDeaf: false,
|
|
2314
2396
|
});
|
|
2315
2397
|
}
|
|
2398
|
+
/** discord.com/developers/docs/resources/lobby#link-channel-to-lobby */
|
|
2399
|
+
async linkChannel(lobbyId, options) {
|
|
2400
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyId), {
|
|
2401
|
+
json: {
|
|
2402
|
+
channel_id: options.channelId,
|
|
2403
|
+
},
|
|
2404
|
+
});
|
|
2405
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2406
|
+
}
|
|
2316
2407
|
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
|
2317
|
-
pinMessage(
|
|
2318
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(
|
|
2408
|
+
pinMessage(channelId, messageId, reason) {
|
|
2409
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(channelId, messageId), {
|
|
2319
2410
|
reason,
|
|
2320
2411
|
});
|
|
2321
2412
|
}
|
|
2322
2413
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
|
|
2323
|
-
removeBan(
|
|
2324
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildBan(
|
|
2414
|
+
removeBan(guildId, userId, reason) {
|
|
2415
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildBan(guildId, userId), {
|
|
2325
2416
|
reason,
|
|
2326
2417
|
});
|
|
2327
2418
|
}
|
|
2328
2419
|
/** https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient */
|
|
2329
|
-
removeGroupRecipient(
|
|
2330
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelRecipient(
|
|
2420
|
+
removeGroupRecipient(channelId, userId) {
|
|
2421
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelRecipient(channelId, userId));
|
|
2331
2422
|
}
|
|
2332
2423
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member */
|
|
2333
|
-
removeGuildMember(
|
|
2334
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMember(
|
|
2424
|
+
removeGuildMember(guildId, userId, reason) {
|
|
2425
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMember(guildId, userId), {
|
|
2335
2426
|
reason,
|
|
2336
2427
|
});
|
|
2337
2428
|
}
|
|
2338
2429
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
|
2339
|
-
removeGuildMemberRole(
|
|
2340
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMemberRole(
|
|
2430
|
+
removeGuildMemberRole(guildId, userId, roleId, reason) {
|
|
2431
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMemberRole(guildId, userId, roleId), {
|
|
2341
2432
|
reason,
|
|
2342
2433
|
});
|
|
2343
2434
|
}
|
|
2435
|
+
/** https://discord.com/developers/docs/resources/lobby#remove-a-member-from-a-lobby */
|
|
2436
|
+
removeLobbyMember(lobbyId, userId) {
|
|
2437
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyId, userId));
|
|
2438
|
+
}
|
|
2344
2439
|
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
|
2345
|
-
removeThreadMember(
|
|
2346
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(
|
|
2440
|
+
removeThreadMember(channelId, userId) {
|
|
2441
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelId, userId));
|
|
2347
2442
|
}
|
|
2348
2443
|
/** https://discord.com/developers/docs/resources/guild#search-guild-members */
|
|
2349
|
-
async searchGuildMembers(
|
|
2350
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembersSearch(
|
|
2444
|
+
async searchGuildMembers(guildId, options) {
|
|
2445
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembersSearch(guildId), {
|
|
2351
2446
|
query: {
|
|
2352
2447
|
query: options.query,
|
|
2353
2448
|
limit: options.limit,
|
|
@@ -2356,35 +2451,40 @@ class Client extends node_events_1.default {
|
|
|
2356
2451
|
return response.map((guildMember) => transformers_1.Guilds.guildMemberFromRaw(guildMember));
|
|
2357
2452
|
}
|
|
2358
2453
|
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
|
2359
|
-
sendSoundboardSound(
|
|
2360
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.sendSoundboardSound(
|
|
2454
|
+
sendSoundboardSound(channelId, options) {
|
|
2455
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.sendSoundboardSound(channelId), {
|
|
2361
2456
|
json: {
|
|
2362
|
-
sound_id: options.
|
|
2363
|
-
source_guild_id: options.
|
|
2457
|
+
sound_id: options.soundId,
|
|
2458
|
+
source_guild_id: options.sourceGuildId,
|
|
2364
2459
|
},
|
|
2365
2460
|
});
|
|
2366
2461
|
}
|
|
2367
2462
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
|
2368
2463
|
setPresence(options) {
|
|
2369
|
-
this.shards.forEach((shard) => shard.updatePresence(options));
|
|
2464
|
+
this.shards.forEach((shard) => shard.transmitter.updatePresence(options));
|
|
2370
2465
|
}
|
|
2371
2466
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
|
2372
|
-
async syncGuildTemplate(
|
|
2373
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildTemplate(
|
|
2467
|
+
async syncGuildTemplate(guildId, code) {
|
|
2468
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildTemplate(guildId, code));
|
|
2374
2469
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
2375
2470
|
}
|
|
2376
2471
|
/** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
|
|
2377
|
-
triggerTypingIndicator(
|
|
2378
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(
|
|
2472
|
+
triggerTypingIndicator(channelId) {
|
|
2473
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(channelId));
|
|
2474
|
+
}
|
|
2475
|
+
/** https://discord.com/developers/docs/resources/lobby#unlink-channel-from-lobby */
|
|
2476
|
+
async unlinkChannel(lobbyId) {
|
|
2477
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyId));
|
|
2478
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2379
2479
|
}
|
|
2380
2480
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
|
2381
|
-
async updateApplicationRoleConnectionMetadataRecords(
|
|
2382
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationRoleConnectionMetadata(
|
|
2481
|
+
async updateApplicationRoleConnectionMetadataRecords(applicationId) {
|
|
2482
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationId));
|
|
2383
2483
|
return response.map((applicationRoleConnectionMetadata) => transformers_1.ApplicationRoleConnectionMetadatas.applicationRoleConnectionMetadataFromRaw(applicationRoleConnectionMetadata));
|
|
2384
2484
|
}
|
|
2385
2485
|
/** https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection */
|
|
2386
|
-
async updateCurrentApplicationRoleConnection(
|
|
2387
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.userApplicationRoleConnection(
|
|
2486
|
+
async updateCurrentApplicationRoleConnection(applicationId, options) {
|
|
2487
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.userApplicationRoleConnection(applicationId), {
|
|
2388
2488
|
json: {
|
|
2389
2489
|
platform_name: options.platformName,
|
|
2390
2490
|
platform_username: options.platformUsername,
|
|
@@ -2400,8 +2500,8 @@ class Client extends node_events_1.default {
|
|
|
2400
2500
|
};
|
|
2401
2501
|
}
|
|
2402
2502
|
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
|
2403
|
-
unpinMessage(
|
|
2404
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPin(
|
|
2503
|
+
unpinMessage(channelId, messageId, reason) {
|
|
2504
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPin(channelId, messageId), {
|
|
2405
2505
|
reason,
|
|
2406
2506
|
});
|
|
2407
2507
|
}
|