disgroove 2.2.7 → 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 +295 -300
- package/dist/lib/Client.js +480 -473
- package/dist/lib/constants.d.ts +7 -4
- package/dist/lib/constants.js +6 -3
- 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 +120 -584
- 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 +4 -0
- package/dist/lib/index.js +4 -0
- package/dist/lib/rest/Endpoints.d.ts +94 -94
- package/dist/lib/rest/Endpoints.js +104 -104
- 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 +3 -1
- package/dist/lib/transformers/Components.js +42 -16
- 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 +74 -44
- package/dist/lib/transformers/Lobbies.js +2 -2
- package/dist/lib/transformers/Messages.js +18 -18
- 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 +6 -6
- 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/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 +79 -19
- 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 +387 -210
- 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 +33 -17
- package/dist/lib/types/interaction.d.ts +26 -13
- package/dist/lib/types/invite.d.ts +3 -0
- package/dist/lib/types/lobby.d.ts +3 -1
- package/dist/lib/types/message.d.ts +29 -15
- package/dist/lib/types/poll.d.ts +7 -1
- package/dist/lib/types/role.d.ts +6 -3
- 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 +6 -6
- package/dist/lib/utils/formatters.js +27 -28
- 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 +1 -1
- package/package.json +2 -2
- package/dist/lib/types/message-components.d.ts +0 -450
- package/dist/lib/types/message-components.js +0 -2
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,25 +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
|
}
|
|
79
81
|
/** https://discord.com/developers/docs/resources/lobby#add-a-member-to-a-lobby */
|
|
80
|
-
async addLobbyMember(
|
|
81
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbyMember(
|
|
82
|
+
async addLobbyMember(lobbyId, userId, options) {
|
|
83
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbyMember(lobbyId, userId), {
|
|
82
84
|
json: options,
|
|
83
85
|
});
|
|
84
86
|
return transformers_1.Lobbies.lobbyMemberFromRaw(response);
|
|
85
87
|
}
|
|
86
88
|
/** https://discord.com/developers/docs/resources/channel#add-thread-member */
|
|
87
|
-
addThreadMember(
|
|
88
|
-
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));
|
|
89
91
|
}
|
|
90
92
|
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
|
|
91
|
-
beginGuildPrune(
|
|
92
|
-
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), {
|
|
93
95
|
json: {
|
|
94
96
|
days: options.days,
|
|
95
97
|
compute_prune_count: options.computePruneCount,
|
|
@@ -99,10 +101,10 @@ class Client extends node_events_1.default {
|
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
103
|
/** https://discord.com/developers/docs/resources/guild#bulk-guild-ban */
|
|
102
|
-
async bulkGuildBan(
|
|
103
|
-
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), {
|
|
104
106
|
json: {
|
|
105
|
-
user_ids: options.
|
|
107
|
+
user_ids: options.userIds,
|
|
106
108
|
delete_message_seconds: options.deleteMessageSeconds,
|
|
107
109
|
},
|
|
108
110
|
reason,
|
|
@@ -113,8 +115,8 @@ class Client extends node_events_1.default {
|
|
|
113
115
|
};
|
|
114
116
|
}
|
|
115
117
|
/** https://discord.com/developers/docs/resources/message#bulk-delete-messages */
|
|
116
|
-
bulkDeleteMessages(
|
|
117
|
-
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), {
|
|
118
120
|
json: {
|
|
119
121
|
messages: options?.messages,
|
|
120
122
|
},
|
|
@@ -122,8 +124,8 @@ class Client extends node_events_1.default {
|
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
126
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
|
|
125
|
-
async bulkEditGlobalApplicationCommands(
|
|
126
|
-
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), {
|
|
127
129
|
json: commands.map((command) => ({
|
|
128
130
|
id: command.id,
|
|
129
131
|
name: command.name,
|
|
@@ -141,8 +143,8 @@ class Client extends node_events_1.default {
|
|
|
141
143
|
return response.map((c) => transformers_1.ApplicationCommands.applicationCommandFromRaw(c));
|
|
142
144
|
}
|
|
143
145
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
|
|
144
|
-
async bulkEditGuildApplicationCommands(
|
|
145
|
-
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), {
|
|
146
148
|
json: commands.map((command) => ({
|
|
147
149
|
id: command.id,
|
|
148
150
|
name: command.name,
|
|
@@ -168,12 +170,12 @@ class Client extends node_events_1.default {
|
|
|
168
170
|
this.shards.forEach((shard) => shard.connect());
|
|
169
171
|
}
|
|
170
172
|
/** https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement */
|
|
171
|
-
consumeEntitlement(
|
|
172
|
-
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));
|
|
173
175
|
}
|
|
174
176
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
|
175
|
-
async createAutoModerationRule(
|
|
176
|
-
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), {
|
|
177
179
|
json: {
|
|
178
180
|
name: options.name,
|
|
179
181
|
event_type: options.eventType,
|
|
@@ -191,15 +193,15 @@ class Client extends node_events_1.default {
|
|
|
191
193
|
return transformers_1.AutoModeration.autoModerationRuleFromRaw(response);
|
|
192
194
|
}
|
|
193
195
|
/** https://discord.com/developers/docs/resources/emoji#create-application-emoji */
|
|
194
|
-
async createApplicationEmoji(
|
|
195
|
-
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), {
|
|
196
198
|
json: options,
|
|
197
199
|
});
|
|
198
200
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
199
201
|
}
|
|
200
202
|
/** https://discord.com/developers/docs/resources/guild#create-guild-channel */
|
|
201
|
-
async createChannel(
|
|
202
|
-
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), {
|
|
203
205
|
json: {
|
|
204
206
|
name: options.name,
|
|
205
207
|
type: options.type,
|
|
@@ -209,7 +211,7 @@ class Client extends node_events_1.default {
|
|
|
209
211
|
rate_limit_per_user: options.rateLimitPerUser,
|
|
210
212
|
position: options.position,
|
|
211
213
|
permission_overwrites: options.permissionOverwrites,
|
|
212
|
-
parent_id: options.
|
|
214
|
+
parent_id: options.parentId,
|
|
213
215
|
nsfw: options.nsfw,
|
|
214
216
|
rtc_region: options.rtcRegion,
|
|
215
217
|
video_quality_mode: options.videoQualityMode,
|
|
@@ -217,7 +219,7 @@ class Client extends node_events_1.default {
|
|
|
217
219
|
default_reaction_emoji: options.defaultReactionEmoji !== undefined
|
|
218
220
|
? options.defaultReactionEmoji !== null
|
|
219
221
|
? {
|
|
220
|
-
emoji_id: options.defaultReactionEmoji.
|
|
222
|
+
emoji_id: options.defaultReactionEmoji.emojiId,
|
|
221
223
|
emoji_name: options.defaultReactionEmoji.emojiName,
|
|
222
224
|
}
|
|
223
225
|
: null
|
|
@@ -232,24 +234,24 @@ class Client extends node_events_1.default {
|
|
|
232
234
|
return transformers_1.Channels.channelFromRaw(response);
|
|
233
235
|
}
|
|
234
236
|
/** https://discord.com/developers/docs/resources/channel#create-channel-invite */
|
|
235
|
-
async createChannelInvite(
|
|
236
|
-
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), {
|
|
237
239
|
json: {
|
|
238
240
|
max_age: options.maxAge,
|
|
239
241
|
max_uses: options.maxUses,
|
|
240
242
|
temporary: options.temporary,
|
|
241
243
|
unique: options.unique,
|
|
242
244
|
target_type: options.targetType,
|
|
243
|
-
target_user_id: options.
|
|
244
|
-
target_application_id: options.
|
|
245
|
+
target_user_id: options.targetUserId,
|
|
246
|
+
target_application_id: options.targetApplicationId,
|
|
245
247
|
},
|
|
246
248
|
reason,
|
|
247
249
|
});
|
|
248
250
|
return transformers_1.Invites.inviteFromRaw(response);
|
|
249
251
|
}
|
|
250
252
|
/** https://discord.com/developers/docs/resources/webhook#create-webhook */
|
|
251
|
-
async createChannelWebhook(
|
|
252
|
-
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), {
|
|
253
255
|
json: {
|
|
254
256
|
name: options.name,
|
|
255
257
|
avatar: options.avatar,
|
|
@@ -262,14 +264,14 @@ class Client extends node_events_1.default {
|
|
|
262
264
|
async createDM(options) {
|
|
263
265
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.userChannels(), {
|
|
264
266
|
json: {
|
|
265
|
-
recipient_id: options.
|
|
267
|
+
recipient_id: options.recipientId,
|
|
266
268
|
},
|
|
267
269
|
});
|
|
268
270
|
return transformers_1.Channels.channelFromRaw(response);
|
|
269
271
|
}
|
|
270
272
|
/** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
|
|
271
|
-
async createGlobalApplicationCommand(
|
|
272
|
-
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), {
|
|
273
275
|
json: {
|
|
274
276
|
name: options.name,
|
|
275
277
|
name_localizations: options.nameLocalizations,
|
|
@@ -296,8 +298,8 @@ class Client extends node_events_1.default {
|
|
|
296
298
|
return transformers_1.Channels.channelFromRaw(response);
|
|
297
299
|
}
|
|
298
300
|
/** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
|
|
299
|
-
async createGuildApplicationCommand(
|
|
300
|
-
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), {
|
|
301
303
|
json: {
|
|
302
304
|
name: options.name,
|
|
303
305
|
name_localizations: options.nameLocalizations,
|
|
@@ -312,8 +314,8 @@ class Client extends node_events_1.default {
|
|
|
312
314
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
313
315
|
}
|
|
314
316
|
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
|
|
315
|
-
createGuildBan(
|
|
316
|
-
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), {
|
|
317
319
|
json: {
|
|
318
320
|
delete_message_days: options?.deleteMessageDays,
|
|
319
321
|
delete_message_seconds: options?.deleteMessageSeconds,
|
|
@@ -322,8 +324,8 @@ class Client extends node_events_1.default {
|
|
|
322
324
|
});
|
|
323
325
|
}
|
|
324
326
|
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
|
|
325
|
-
async createGuildEmoji(
|
|
326
|
-
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), {
|
|
327
329
|
json: {
|
|
328
330
|
name: options.name,
|
|
329
331
|
image: options.image,
|
|
@@ -334,8 +336,8 @@ class Client extends node_events_1.default {
|
|
|
334
336
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
335
337
|
}
|
|
336
338
|
/** https://discord.com/developers/docs/resources/guild#create-guild-role */
|
|
337
|
-
async createGuildRole(
|
|
338
|
-
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), {
|
|
339
341
|
json: {
|
|
340
342
|
name: options.name,
|
|
341
343
|
permissions: options.permissions,
|
|
@@ -355,10 +357,10 @@ class Client extends node_events_1.default {
|
|
|
355
357
|
return transformers_1.Roles.roleFromRaw(response);
|
|
356
358
|
}
|
|
357
359
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
|
|
358
|
-
async createGuildScheduledEvent(
|
|
359
|
-
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), {
|
|
360
362
|
json: {
|
|
361
|
-
channel_id: options.
|
|
363
|
+
channel_id: options.channelId,
|
|
362
364
|
entity_metadata: options.entityMetadata,
|
|
363
365
|
name: options.name,
|
|
364
366
|
privacy_level: options.privacyLevel,
|
|
@@ -376,26 +378,26 @@ class Client extends node_events_1.default {
|
|
|
376
378
|
return transformers_1.GuildScheduledEvents.guildScheduledEventFromRaw(response);
|
|
377
379
|
}
|
|
378
380
|
/** https://discord.com/developers/docs/resources/sticker#create-guild-sticker */
|
|
379
|
-
async createGuildSticker(
|
|
381
|
+
async createGuildSticker(guildId, options, reason) {
|
|
380
382
|
const formData = new FormData();
|
|
381
383
|
formData.set("name", options.name);
|
|
382
384
|
formData.set("description", options.description);
|
|
383
385
|
formData.set("tags", options.tags);
|
|
384
386
|
formData.set("file", new Blob([options.file.contents]), options.file.name);
|
|
385
|
-
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), {
|
|
386
388
|
form: formData,
|
|
387
389
|
reason,
|
|
388
390
|
});
|
|
389
391
|
return transformers_1.Stickers.stickerFromRaw(response);
|
|
390
392
|
}
|
|
391
393
|
/** https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound */
|
|
392
|
-
async createGuildSoundboardSound(
|
|
393
|
-
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), {
|
|
394
396
|
json: {
|
|
395
397
|
name: options.name,
|
|
396
398
|
sound: options.sound,
|
|
397
399
|
volume: options.volume,
|
|
398
|
-
emoji_id: options.
|
|
400
|
+
emoji_id: options.emojiId,
|
|
399
401
|
emoji_name: options.emojiName,
|
|
400
402
|
},
|
|
401
403
|
reason,
|
|
@@ -403,8 +405,8 @@ class Client extends node_events_1.default {
|
|
|
403
405
|
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
|
404
406
|
}
|
|
405
407
|
/** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
|
|
406
|
-
async createGuildTemplate(
|
|
407
|
-
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), {
|
|
408
410
|
json: {
|
|
409
411
|
name: options.name,
|
|
410
412
|
description: options.description,
|
|
@@ -413,8 +415,8 @@ class Client extends node_events_1.default {
|
|
|
413
415
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
414
416
|
}
|
|
415
417
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */
|
|
416
|
-
async createInteractionFollowupMessage(
|
|
417
|
-
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), {
|
|
418
420
|
json: {
|
|
419
421
|
content: options.content,
|
|
420
422
|
tts: options.tts,
|
|
@@ -439,7 +441,7 @@ class Client extends node_events_1.default {
|
|
|
439
441
|
? {
|
|
440
442
|
question: options.poll.question,
|
|
441
443
|
answers: options.poll.answers.map((answer) => ({
|
|
442
|
-
answer_id: answer.
|
|
444
|
+
answer_id: answer.answerId,
|
|
443
445
|
poll_media: answer.pollMedia,
|
|
444
446
|
})),
|
|
445
447
|
duration: options.poll.duration,
|
|
@@ -453,7 +455,7 @@ class Client extends node_events_1.default {
|
|
|
453
455
|
return transformers_1.Messages.messageFromRaw(response);
|
|
454
456
|
}
|
|
455
457
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
|
|
456
|
-
async createInteractionResponse(
|
|
458
|
+
async createInteractionResponse(interactionId, interactionToken, options) {
|
|
457
459
|
let json;
|
|
458
460
|
let files;
|
|
459
461
|
switch (options.type) {
|
|
@@ -501,7 +503,7 @@ class Client extends node_events_1.default {
|
|
|
501
503
|
? {
|
|
502
504
|
question: options.data.poll.question,
|
|
503
505
|
answers: options.data.poll.answers.map((answer) => ({
|
|
504
|
-
answer_id: answer.
|
|
506
|
+
answer_id: answer.answerId,
|
|
505
507
|
poll_media: answer.pollMedia,
|
|
506
508
|
})),
|
|
507
509
|
duration: options.data.poll.duration,
|
|
@@ -544,7 +546,7 @@ class Client extends node_events_1.default {
|
|
|
544
546
|
json = {
|
|
545
547
|
type: options.type,
|
|
546
548
|
data: {
|
|
547
|
-
custom_id: options.data?.
|
|
549
|
+
custom_id: options.data?.customId,
|
|
548
550
|
components: options.data?.components !== undefined
|
|
549
551
|
? options.data?.components.map((component) => {
|
|
550
552
|
switch (component.type) {
|
|
@@ -573,7 +575,7 @@ class Client extends node_events_1.default {
|
|
|
573
575
|
break;
|
|
574
576
|
}
|
|
575
577
|
if (options.withResponse) {
|
|
576
|
-
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), {
|
|
577
579
|
json,
|
|
578
580
|
query: {
|
|
579
581
|
with_response: options.withResponse,
|
|
@@ -583,7 +585,7 @@ class Client extends node_events_1.default {
|
|
|
583
585
|
return transformers_1.Interactions.interactionCallbackResponseFromRaw(response);
|
|
584
586
|
}
|
|
585
587
|
else {
|
|
586
|
-
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), {
|
|
587
589
|
json,
|
|
588
590
|
query: {
|
|
589
591
|
with_response: options.withResponse,
|
|
@@ -604,8 +606,8 @@ class Client extends node_events_1.default {
|
|
|
604
606
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
605
607
|
}
|
|
606
608
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
607
|
-
async createMessage(
|
|
608
|
-
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), {
|
|
609
611
|
json: {
|
|
610
612
|
content: options.content,
|
|
611
613
|
nonce: options.nonce,
|
|
@@ -621,16 +623,16 @@ class Client extends node_events_1.default {
|
|
|
621
623
|
: undefined,
|
|
622
624
|
message_reference: options.messageReference !== undefined
|
|
623
625
|
? {
|
|
624
|
-
message_id: options.messageReference.
|
|
625
|
-
channel_id: options.messageReference.
|
|
626
|
-
guild_id: options.messageReference.
|
|
626
|
+
message_id: options.messageReference.messageId,
|
|
627
|
+
channel_id: options.messageReference.channelId,
|
|
628
|
+
guild_id: options.messageReference.guildId,
|
|
627
629
|
fail_if_not_exists: options.messageReference.failIfNotExists,
|
|
628
630
|
}
|
|
629
631
|
: undefined,
|
|
630
632
|
components: options.components !== undefined
|
|
631
633
|
? transformers_1.Messages.componentsToRaw(options.components)
|
|
632
634
|
: undefined,
|
|
633
|
-
stickers_ids: options.
|
|
635
|
+
stickers_ids: options.stickersIds,
|
|
634
636
|
attachments: options.attachments,
|
|
635
637
|
flags: options.flags,
|
|
636
638
|
enforce_nonce: options.enforceNonce,
|
|
@@ -638,7 +640,7 @@ class Client extends node_events_1.default {
|
|
|
638
640
|
? {
|
|
639
641
|
question: options.poll.question,
|
|
640
642
|
answers: options.poll.answers.map((answer) => ({
|
|
641
|
-
answer_id: answer.
|
|
643
|
+
answer_id: answer.answerId,
|
|
642
644
|
poll_media: answer.pollMedia,
|
|
643
645
|
})),
|
|
644
646
|
duration: options.poll.duration,
|
|
@@ -652,37 +654,37 @@ class Client extends node_events_1.default {
|
|
|
652
654
|
return transformers_1.Messages.messageFromRaw(response);
|
|
653
655
|
}
|
|
654
656
|
/** https://discord.com/developers/docs/resources/message#create-reaction */
|
|
655
|
-
createMessageReaction(
|
|
656
|
-
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));
|
|
657
659
|
}
|
|
658
660
|
/** https://discord.com/developers/docs/resources/stage-instance#create-stage-instance */
|
|
659
661
|
async createStageInstance(options, reason) {
|
|
660
662
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.stageInstances(), {
|
|
661
663
|
json: {
|
|
662
|
-
channel_id: options.
|
|
664
|
+
channel_id: options.channelId,
|
|
663
665
|
topic: options.topic,
|
|
664
666
|
privacy_level: options.privacyLevel,
|
|
665
667
|
send_start_notifications: options.sendStartNotifications,
|
|
666
|
-
guild_scheduled_event_id: options.
|
|
668
|
+
guild_scheduled_event_id: options.guildScheduledEventId,
|
|
667
669
|
},
|
|
668
670
|
reason,
|
|
669
671
|
});
|
|
670
672
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
|
671
673
|
}
|
|
672
674
|
/** https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */
|
|
673
|
-
async createTestEntitlement(
|
|
674
|
-
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), {
|
|
675
677
|
json: {
|
|
676
|
-
sku_id: options.
|
|
677
|
-
owner_id: options.
|
|
678
|
+
sku_id: options.skuId,
|
|
679
|
+
owner_id: options.ownerId,
|
|
678
680
|
owner_type: options.ownerType,
|
|
679
681
|
},
|
|
680
682
|
});
|
|
681
683
|
return transformers_1.Entitlements.testEntitlementFromRaw(response);
|
|
682
684
|
}
|
|
683
685
|
/** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel */
|
|
684
|
-
async createThread(
|
|
685
|
-
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), {
|
|
686
688
|
json: {
|
|
687
689
|
name: options.name,
|
|
688
690
|
auto_archive_duration: options.autoArchiveDuration,
|
|
@@ -698,7 +700,7 @@ class Client extends node_events_1.default {
|
|
|
698
700
|
replied_user: options.message.allowedMentions.repliedUser,
|
|
699
701
|
}
|
|
700
702
|
: undefined,
|
|
701
|
-
sticker_ids: options.message.
|
|
703
|
+
sticker_ids: options.message.stickerIds,
|
|
702
704
|
attachments: options.message.attachments,
|
|
703
705
|
flags: options.message.flags,
|
|
704
706
|
},
|
|
@@ -710,8 +712,8 @@ class Client extends node_events_1.default {
|
|
|
710
712
|
return transformers_1.Channels.channelFromRaw(response);
|
|
711
713
|
}
|
|
712
714
|
/** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
|
|
713
|
-
async createThreadFromMessage(
|
|
714
|
-
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), {
|
|
715
717
|
json: {
|
|
716
718
|
name: options.name,
|
|
717
719
|
auto_archive_duration: options.autoArchiveDuration,
|
|
@@ -722,8 +724,8 @@ class Client extends node_events_1.default {
|
|
|
722
724
|
return transformers_1.Channels.channelFromRaw(response);
|
|
723
725
|
}
|
|
724
726
|
/** https://discord.com/developers/docs/resources/channel#start-thread-without-message */
|
|
725
|
-
async createThreadWithoutMessage(
|
|
726
|
-
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), {
|
|
727
729
|
json: {
|
|
728
730
|
name: options.name,
|
|
729
731
|
auto_archive_duration: options.autoArchiveDuration,
|
|
@@ -736,82 +738,82 @@ class Client extends node_events_1.default {
|
|
|
736
738
|
return transformers_1.Channels.channelFromRaw(response);
|
|
737
739
|
}
|
|
738
740
|
/** https://discord.com/developers/docs/resources/message#crosspost-message */
|
|
739
|
-
async crosspostMessage(
|
|
740
|
-
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));
|
|
741
743
|
return transformers_1.Messages.messageFromRaw(response);
|
|
742
744
|
}
|
|
743
745
|
/** https://discord.com/developers/docs/resources/message#delete-all-reactions */
|
|
744
|
-
deleteAllMessageReactions(
|
|
745
|
-
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));
|
|
746
748
|
}
|
|
747
749
|
/** https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
|
|
748
|
-
deleteAutoModerationRule(
|
|
749
|
-
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), {
|
|
750
752
|
reason,
|
|
751
753
|
});
|
|
752
754
|
}
|
|
753
755
|
/** https://discord.com/developers/docs/resources/emoji#delete-application-emoji */
|
|
754
|
-
deleteApplicationEmoji(
|
|
755
|
-
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));
|
|
756
758
|
}
|
|
757
759
|
/** https://discord.com/developers/docs/resources/channel#deleteclose-channel */
|
|
758
|
-
async deleteChannel(
|
|
759
|
-
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), {
|
|
760
762
|
reason,
|
|
761
763
|
});
|
|
762
764
|
return transformers_1.Channels.channelFromRaw(response);
|
|
763
765
|
}
|
|
764
766
|
/** https://discord.com/developers/docs/resources/channel#delete-channel-permission */
|
|
765
|
-
deleteChannelPermission(
|
|
766
|
-
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), {
|
|
767
769
|
reason,
|
|
768
770
|
});
|
|
769
771
|
}
|
|
770
772
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
|
|
771
|
-
deleteGlobalApplicationCommand(
|
|
772
|
-
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));
|
|
773
775
|
}
|
|
774
776
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
|
775
|
-
deleteGuildApplicationCommand(
|
|
776
|
-
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));
|
|
777
779
|
}
|
|
778
780
|
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
|
779
|
-
deleteGuildEmoji(
|
|
780
|
-
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), {
|
|
781
783
|
reason,
|
|
782
784
|
});
|
|
783
785
|
}
|
|
784
786
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-integration */
|
|
785
|
-
deleteGuildIntegration(
|
|
786
|
-
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), {
|
|
787
789
|
reason,
|
|
788
790
|
});
|
|
789
791
|
}
|
|
790
792
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-role */
|
|
791
|
-
deleteGuildRole(
|
|
792
|
-
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), {
|
|
793
795
|
reason,
|
|
794
796
|
});
|
|
795
797
|
}
|
|
796
798
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event */
|
|
797
|
-
deleteGuildScheduledEvent(
|
|
798
|
-
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));
|
|
799
801
|
}
|
|
800
802
|
/** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
|
|
801
|
-
deleteGuildSticker(
|
|
802
|
-
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), {
|
|
803
805
|
reason,
|
|
804
806
|
});
|
|
805
807
|
}
|
|
806
808
|
/** https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound */
|
|
807
|
-
deleteGuildSoundboardSound(
|
|
808
|
-
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), {
|
|
809
811
|
reason,
|
|
810
812
|
});
|
|
811
813
|
}
|
|
812
814
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
|
813
|
-
async deleteGuildTemplate(
|
|
814
|
-
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));
|
|
815
817
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
816
818
|
}
|
|
817
819
|
/** https://discord.com/developers/docs/resources/invite#delete-invite */
|
|
@@ -822,64 +824,65 @@ class Client extends node_events_1.default {
|
|
|
822
824
|
return transformers_1.Invites.inviteFromRaw(response);
|
|
823
825
|
}
|
|
824
826
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message */
|
|
825
|
-
deleteInteractionFollowupMessage(
|
|
826
|
-
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));
|
|
827
829
|
}
|
|
828
830
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response */
|
|
829
|
-
deleteInteractionResponse(
|
|
830
|
-
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));
|
|
831
833
|
}
|
|
832
834
|
/** https://discord.com/developers/docs/resources/lobby#delete-lobby */
|
|
833
|
-
deleteLobby(
|
|
834
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobby(
|
|
835
|
+
deleteLobby(lobbyId) {
|
|
836
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobby(lobbyId));
|
|
835
837
|
}
|
|
836
838
|
/** https://discord.com/developers/docs/resources/message#delete-message */
|
|
837
|
-
deleteMessage(
|
|
838
|
-
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), {
|
|
839
841
|
reason,
|
|
840
842
|
});
|
|
841
843
|
}
|
|
842
844
|
/** https://discord.com/developers/docs/resources/message#delete-user-reaction */
|
|
843
|
-
deleteMessageReaction(
|
|
844
|
-
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));
|
|
845
847
|
}
|
|
846
848
|
/** https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance */
|
|
847
|
-
deleteStageInstance(
|
|
848
|
-
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), {
|
|
849
851
|
reason,
|
|
850
852
|
});
|
|
851
853
|
}
|
|
852
854
|
/** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
|
|
853
|
-
deleteTestEntitlement(
|
|
854
|
-
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));
|
|
855
857
|
}
|
|
856
858
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook */
|
|
857
|
-
deleteWebhook(
|
|
858
|
-
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), {
|
|
859
861
|
reason,
|
|
860
862
|
});
|
|
861
863
|
}
|
|
862
864
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook-message */
|
|
863
|
-
deleteWebhookMessage(
|
|
864
|
-
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), {
|
|
865
867
|
query: {
|
|
866
|
-
thread_id: options?.
|
|
868
|
+
thread_id: options?.threadId,
|
|
867
869
|
},
|
|
868
870
|
});
|
|
869
871
|
}
|
|
870
872
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */
|
|
871
|
-
deleteWebhookWithToken(
|
|
872
|
-
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), {
|
|
873
875
|
reason,
|
|
874
876
|
authorization: false,
|
|
875
877
|
});
|
|
876
878
|
}
|
|
879
|
+
/** https://discord.com/developers/docs/events/gateway#initiating-a-disconnect */
|
|
877
880
|
disconnect() {
|
|
878
|
-
this.shards.forEach((shard) => shard.disconnect());
|
|
881
|
+
this.shards.forEach((shard) => shard.disconnect(false));
|
|
879
882
|
}
|
|
880
883
|
/** https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule */
|
|
881
|
-
async editAutoModerationRule(
|
|
882
|
-
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), {
|
|
883
886
|
json: {
|
|
884
887
|
name: options.name,
|
|
885
888
|
event_type: options.eventType,
|
|
@@ -897,8 +900,8 @@ class Client extends node_events_1.default {
|
|
|
897
900
|
return transformers_1.AutoModeration.autoModerationRuleFromRaw(response);
|
|
898
901
|
}
|
|
899
902
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
|
900
|
-
async editApplicationCommandPermissions(
|
|
901
|
-
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), {
|
|
902
905
|
json: {
|
|
903
906
|
permissions: options.permissions.map((permission) => ({
|
|
904
907
|
id: permission.type,
|
|
@@ -910,15 +913,15 @@ class Client extends node_events_1.default {
|
|
|
910
913
|
return transformers_1.Guilds.guildApplicationCommandPermissionsFromRaw(response);
|
|
911
914
|
}
|
|
912
915
|
/** https://discord.com/developers/docs/resources/emoji#modify-application-emoji */
|
|
913
|
-
async editApplicationEmoji(
|
|
914
|
-
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), {
|
|
915
918
|
json: options,
|
|
916
919
|
});
|
|
917
920
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
918
921
|
}
|
|
919
922
|
/** https://discord.com/developers/docs/resources/channel#modify-channel */
|
|
920
|
-
async editChannel(
|
|
921
|
-
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), {
|
|
922
925
|
json: {
|
|
923
926
|
name: options.name,
|
|
924
927
|
icon: options.icon,
|
|
@@ -930,7 +933,7 @@ class Client extends node_events_1.default {
|
|
|
930
933
|
bitrate: options.bitrate,
|
|
931
934
|
user_limit: options.userLimit,
|
|
932
935
|
permission_overwrites: options.permissionOverwrites,
|
|
933
|
-
parent_id: options.
|
|
936
|
+
parent_id: options.parentId,
|
|
934
937
|
rtc_region: options.rtcRegion,
|
|
935
938
|
video_quality_mode: options.videoQualityMode,
|
|
936
939
|
default_auto_archive_duration: options.defaultAutoArchiveDuration,
|
|
@@ -939,7 +942,7 @@ class Client extends node_events_1.default {
|
|
|
939
942
|
default_reaction_emoji: options.defaultReactionEmoji !== undefined
|
|
940
943
|
? options.defaultReactionEmoji !== null
|
|
941
944
|
? {
|
|
942
|
-
emoji_id: options.defaultReactionEmoji.
|
|
945
|
+
emoji_id: options.defaultReactionEmoji.emojiId,
|
|
943
946
|
emoji_name: options.defaultReactionEmoji.emojiName,
|
|
944
947
|
}
|
|
945
948
|
: null
|
|
@@ -958,20 +961,20 @@ class Client extends node_events_1.default {
|
|
|
958
961
|
return transformers_1.Channels.channelFromRaw(response);
|
|
959
962
|
}
|
|
960
963
|
/** https://discord.com/developers/docs/resources/channel#edit-channel-permissions */
|
|
961
|
-
editChannelPermissions(
|
|
962
|
-
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), {
|
|
963
966
|
json: options,
|
|
964
967
|
reason,
|
|
965
968
|
});
|
|
966
969
|
}
|
|
967
970
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
|
|
968
|
-
editChannelPositions(
|
|
969
|
-
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), {
|
|
970
973
|
json: options.map((data) => ({
|
|
971
974
|
id: data.id,
|
|
972
975
|
position: data.position,
|
|
973
976
|
lock_permissions: data.lockPermissions,
|
|
974
|
-
parent_id: data.
|
|
977
|
+
parent_id: data.parentId,
|
|
975
978
|
})),
|
|
976
979
|
});
|
|
977
980
|
}
|
|
@@ -987,18 +990,18 @@ class Client extends node_events_1.default {
|
|
|
987
990
|
return transformers_1.Users.userFromRaw(response);
|
|
988
991
|
}
|
|
989
992
|
/** https://discord.com/developers/docs/resources/guild#modify-current-member */
|
|
990
|
-
async editCurrentGuildMember(
|
|
991
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(
|
|
993
|
+
async editCurrentGuildMember(guildId, options, reason) {
|
|
994
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(guildId), {
|
|
992
995
|
json: options,
|
|
993
996
|
reason,
|
|
994
997
|
});
|
|
995
998
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
996
999
|
}
|
|
997
1000
|
/** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
|
|
998
|
-
editCurrentUserVoiceState(
|
|
999
|
-
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), {
|
|
1000
1003
|
json: {
|
|
1001
|
-
channel_id: options.
|
|
1004
|
+
channel_id: options.channelId,
|
|
1002
1005
|
suppress: options.suppress,
|
|
1003
1006
|
requestToSpeakTimestamp: options.requestToSpeakTimestamp,
|
|
1004
1007
|
},
|
|
@@ -1032,8 +1035,8 @@ class Client extends node_events_1.default {
|
|
|
1032
1035
|
return transformers_1.Applications.applicationFromRaw(response);
|
|
1033
1036
|
}
|
|
1034
1037
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
|
|
1035
|
-
async editGlobalApplicationCommand(
|
|
1036
|
-
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), {
|
|
1037
1040
|
json: {
|
|
1038
1041
|
name: options.name,
|
|
1039
1042
|
name_localizations: options.nameLocalizations,
|
|
@@ -1049,36 +1052,36 @@ class Client extends node_events_1.default {
|
|
|
1049
1052
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
1050
1053
|
}
|
|
1051
1054
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
|
1052
|
-
async editGuild(
|
|
1053
|
-
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), {
|
|
1054
1057
|
json: {
|
|
1055
1058
|
name: options.name,
|
|
1056
1059
|
verification_level: options.verificationLevel,
|
|
1057
1060
|
default_message_notifications: options.defaultMessageNotifications,
|
|
1058
1061
|
explicit_content_filter: options.explicitContentFilter,
|
|
1059
|
-
afk_channel_id: options.
|
|
1062
|
+
afk_channel_id: options.afkChannelId,
|
|
1060
1063
|
afk_timeout: options.afkTimeout,
|
|
1061
1064
|
icon: options.icon,
|
|
1062
1065
|
splash: options.splash,
|
|
1063
1066
|
discovery_splash: options.discoverySplash,
|
|
1064
1067
|
banner: options.banner,
|
|
1065
|
-
system_channel_id: options.
|
|
1068
|
+
system_channel_id: options.systemChannelId,
|
|
1066
1069
|
system_channel_flags: options.systemChannelFlags,
|
|
1067
|
-
rules_channel_id: options.
|
|
1068
|
-
public_updates_channel_id: options.
|
|
1070
|
+
rules_channel_id: options.rulesChannelId,
|
|
1071
|
+
public_updates_channel_id: options.publicUpdatesChannelId,
|
|
1069
1072
|
preferred_locale: options.preferredLocale,
|
|
1070
1073
|
features: options.features,
|
|
1071
1074
|
description: options.description,
|
|
1072
1075
|
premium_progress_bar_enabled: options.premiumProgressBarEnabled,
|
|
1073
|
-
safety_alerts_channel_id: options.
|
|
1076
|
+
safety_alerts_channel_id: options.safetyAlertsChannelId,
|
|
1074
1077
|
},
|
|
1075
1078
|
reason,
|
|
1076
1079
|
});
|
|
1077
1080
|
return transformers_1.Guilds.guildFromRaw(response);
|
|
1078
1081
|
}
|
|
1079
1082
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
|
|
1080
|
-
async editGuildApplicationCommand(
|
|
1081
|
-
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), {
|
|
1082
1085
|
json: {
|
|
1083
1086
|
name: options.name,
|
|
1084
1087
|
name_localizations: options.nameLocalizations,
|
|
@@ -1092,8 +1095,8 @@ class Client extends node_events_1.default {
|
|
|
1092
1095
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
1093
1096
|
}
|
|
1094
1097
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
|
|
1095
|
-
async editGuildEmoji(
|
|
1096
|
-
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), {
|
|
1097
1100
|
json: {
|
|
1098
1101
|
name: options.name,
|
|
1099
1102
|
roles: options.roles,
|
|
@@ -1103,8 +1106,8 @@ class Client extends node_events_1.default {
|
|
|
1103
1106
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
1104
1107
|
}
|
|
1105
1108
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-incidents-actions */
|
|
1106
|
-
async editGuildIncidentsActions(
|
|
1107
|
-
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), {
|
|
1108
1111
|
json: {
|
|
1109
1112
|
invites_disabled_until: options?.invitesDisabledUntil,
|
|
1110
1113
|
dms_disabled_until: options?.dmsDisabledUntil,
|
|
@@ -1119,14 +1122,14 @@ class Client extends node_events_1.default {
|
|
|
1119
1122
|
};
|
|
1120
1123
|
}
|
|
1121
1124
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
|
|
1122
|
-
async editGuildMember(
|
|
1123
|
-
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), {
|
|
1124
1127
|
json: {
|
|
1125
1128
|
nick: options.nick,
|
|
1126
1129
|
roles: options.roles,
|
|
1127
1130
|
mute: options.mute,
|
|
1128
1131
|
deaf: options.deaf,
|
|
1129
|
-
channel_id: options.
|
|
1132
|
+
channel_id: options.channelId,
|
|
1130
1133
|
communication_disabled_until: options.communicationDisabledUntil,
|
|
1131
1134
|
flags: options.flags,
|
|
1132
1135
|
},
|
|
@@ -1135,20 +1138,20 @@ class Client extends node_events_1.default {
|
|
|
1135
1138
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
1136
1139
|
}
|
|
1137
1140
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
|
|
1138
|
-
editGuildOnboarding(
|
|
1139
|
-
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), {
|
|
1140
1143
|
json: {
|
|
1141
1144
|
prompts: options.prompts?.map((prompt) => ({
|
|
1142
1145
|
id: prompt.id,
|
|
1143
1146
|
type: prompt.type,
|
|
1144
1147
|
options: prompt.options.map((promptOption) => ({
|
|
1145
1148
|
id: promptOption.id,
|
|
1146
|
-
channel_ids: promptOption.
|
|
1147
|
-
role_ids: promptOption.
|
|
1149
|
+
channel_ids: promptOption.channelIds,
|
|
1150
|
+
role_ids: promptOption.roleIds,
|
|
1148
1151
|
emoji: promptOption.emoji !== undefined
|
|
1149
1152
|
? transformers_1.Emojis.emojiToRaw(promptOption.emoji)
|
|
1150
1153
|
: undefined,
|
|
1151
|
-
emoji_id: promptOption.
|
|
1154
|
+
emoji_id: promptOption.emojiId,
|
|
1152
1155
|
emoji_name: promptOption.emojiName,
|
|
1153
1156
|
emoji_animated: promptOption.emojiAnimated,
|
|
1154
1157
|
title: promptOption.title,
|
|
@@ -1164,8 +1167,8 @@ class Client extends node_events_1.default {
|
|
|
1164
1167
|
});
|
|
1165
1168
|
}
|
|
1166
1169
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role */
|
|
1167
|
-
async editGuildRole(
|
|
1168
|
-
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), {
|
|
1169
1172
|
json: {
|
|
1170
1173
|
name: options?.name,
|
|
1171
1174
|
permissions: options?.permissions,
|
|
@@ -1185,18 +1188,18 @@ class Client extends node_events_1.default {
|
|
|
1185
1188
|
return transformers_1.Roles.roleFromRaw(response);
|
|
1186
1189
|
}
|
|
1187
1190
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
|
|
1188
|
-
async editGuildRolePositions(
|
|
1189
|
-
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), {
|
|
1190
1193
|
json: options,
|
|
1191
1194
|
reason,
|
|
1192
1195
|
});
|
|
1193
1196
|
return response.map((role) => transformers_1.Roles.roleFromRaw(role));
|
|
1194
1197
|
}
|
|
1195
1198
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
|
|
1196
|
-
async editGuildScheduledEvent(
|
|
1197
|
-
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), {
|
|
1198
1201
|
json: {
|
|
1199
|
-
channel_id: options.
|
|
1202
|
+
channel_id: options.channelId,
|
|
1200
1203
|
entity_metadata: options.entityMetadata,
|
|
1201
1204
|
name: options.name,
|
|
1202
1205
|
privacy_level: options.privacyLevel,
|
|
@@ -1217,8 +1220,8 @@ class Client extends node_events_1.default {
|
|
|
1217
1220
|
return transformers_1.GuildScheduledEvents.guildScheduledEventFromRaw(response);
|
|
1218
1221
|
}
|
|
1219
1222
|
/** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
|
|
1220
|
-
async editGuildSticker(
|
|
1221
|
-
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), {
|
|
1222
1225
|
json: {
|
|
1223
1226
|
name: options.name,
|
|
1224
1227
|
description: options.description,
|
|
@@ -1229,12 +1232,12 @@ class Client extends node_events_1.default {
|
|
|
1229
1232
|
return transformers_1.Stickers.stickerFromRaw(response);
|
|
1230
1233
|
}
|
|
1231
1234
|
/** https://discord.com/developers/docs/resources/soundboard#edit-guild-soundboard-sound */
|
|
1232
|
-
async editGuildSoundboardSound(
|
|
1233
|
-
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), {
|
|
1234
1237
|
json: {
|
|
1235
1238
|
name: options.name,
|
|
1236
1239
|
volume: options.volume,
|
|
1237
|
-
emoji_id: options.
|
|
1240
|
+
emoji_id: options.emojiId,
|
|
1238
1241
|
emoji_name: options.emojiName,
|
|
1239
1242
|
},
|
|
1240
1243
|
reason,
|
|
@@ -1242,8 +1245,8 @@ class Client extends node_events_1.default {
|
|
|
1242
1245
|
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
|
1243
1246
|
}
|
|
1244
1247
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
|
1245
|
-
async editGuildTemplate(
|
|
1246
|
-
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), {
|
|
1247
1250
|
json: {
|
|
1248
1251
|
name: options.name,
|
|
1249
1252
|
description: options.description,
|
|
@@ -1252,14 +1255,14 @@ class Client extends node_events_1.default {
|
|
|
1252
1255
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
1253
1256
|
}
|
|
1254
1257
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
|
|
1255
|
-
async editGuildWelcomeScreen(
|
|
1256
|
-
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), {
|
|
1257
1260
|
json: {
|
|
1258
1261
|
enabled: options.enabled,
|
|
1259
1262
|
welcome_channels: options.welcomeChannels?.map((welcomeChannel) => ({
|
|
1260
|
-
channel_id: welcomeChannel.
|
|
1263
|
+
channel_id: welcomeChannel.channelId,
|
|
1261
1264
|
description: welcomeChannel.description,
|
|
1262
|
-
emoji_id: welcomeChannel.
|
|
1265
|
+
emoji_id: welcomeChannel.emojiId,
|
|
1263
1266
|
emoji_name: welcomeChannel.emojiName,
|
|
1264
1267
|
})),
|
|
1265
1268
|
description: options.description,
|
|
@@ -1269,30 +1272,30 @@ class Client extends node_events_1.default {
|
|
|
1269
1272
|
return {
|
|
1270
1273
|
description: response.description,
|
|
1271
1274
|
welcomeChannels: response.welcome_channels.map((welcomeScreenChannel) => ({
|
|
1272
|
-
|
|
1275
|
+
channelId: welcomeScreenChannel.channel_id,
|
|
1273
1276
|
description: welcomeScreenChannel.description,
|
|
1274
|
-
|
|
1277
|
+
emojiId: welcomeScreenChannel.emoji_id,
|
|
1275
1278
|
emojiName: welcomeScreenChannel.emoji_name,
|
|
1276
1279
|
})),
|
|
1277
1280
|
};
|
|
1278
1281
|
}
|
|
1279
1282
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-widget */
|
|
1280
|
-
async editGuildWidget(
|
|
1281
|
-
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), {
|
|
1282
1285
|
json: {
|
|
1283
1286
|
enabled: options.enabled,
|
|
1284
|
-
channel_id: options.
|
|
1287
|
+
channel_id: options.channelId,
|
|
1285
1288
|
},
|
|
1286
1289
|
reason,
|
|
1287
1290
|
});
|
|
1288
1291
|
return {
|
|
1289
1292
|
enabled: response.enabled,
|
|
1290
|
-
|
|
1293
|
+
channelId: response.channel_id,
|
|
1291
1294
|
};
|
|
1292
1295
|
}
|
|
1293
1296
|
/** https://discord.com/developers/docs/resources/lobby#modify-lobby */
|
|
1294
|
-
async editLobby(
|
|
1295
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobby(
|
|
1297
|
+
async editLobby(lobbyId, options) {
|
|
1298
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobby(lobbyId), {
|
|
1296
1299
|
json: {
|
|
1297
1300
|
metadata: options.metadata,
|
|
1298
1301
|
members: options.members,
|
|
@@ -1302,8 +1305,8 @@ class Client extends node_events_1.default {
|
|
|
1302
1305
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
1303
1306
|
}
|
|
1304
1307
|
/** https://discord.com/developers/docs/resources/message#edit-message */
|
|
1305
|
-
async editMessage(
|
|
1306
|
-
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), {
|
|
1307
1310
|
json: {
|
|
1308
1311
|
content: options.content,
|
|
1309
1312
|
embeds: options.embeds !== null
|
|
@@ -1332,8 +1335,8 @@ class Client extends node_events_1.default {
|
|
|
1332
1335
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1333
1336
|
}
|
|
1334
1337
|
/** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance */
|
|
1335
|
-
async editStageInstance(
|
|
1336
|
-
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), {
|
|
1337
1340
|
json: {
|
|
1338
1341
|
topic: options.topic,
|
|
1339
1342
|
privacy_level: options.privacyLevel,
|
|
@@ -1343,8 +1346,8 @@ class Client extends node_events_1.default {
|
|
|
1343
1346
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
|
1344
1347
|
}
|
|
1345
1348
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message */
|
|
1346
|
-
async editInteractionFollowupMessage(
|
|
1347
|
-
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), {
|
|
1348
1351
|
json: {
|
|
1349
1352
|
content: options.content,
|
|
1350
1353
|
embeds: options.embeds !== null
|
|
@@ -1386,7 +1389,7 @@ class Client extends node_events_1.default {
|
|
|
1386
1389
|
? {
|
|
1387
1390
|
question: options.poll.question,
|
|
1388
1391
|
answers: options.poll.answers.map((answer) => ({
|
|
1389
|
-
answer_id: answer.
|
|
1392
|
+
answer_id: answer.answerId,
|
|
1390
1393
|
poll_media: answer.pollMedia,
|
|
1391
1394
|
})),
|
|
1392
1395
|
duration: options.poll.duration,
|
|
@@ -1398,14 +1401,14 @@ class Client extends node_events_1.default {
|
|
|
1398
1401
|
},
|
|
1399
1402
|
files: options.files,
|
|
1400
1403
|
query: {
|
|
1401
|
-
thread_id: options.
|
|
1404
|
+
thread_id: options.threadId,
|
|
1402
1405
|
},
|
|
1403
1406
|
});
|
|
1404
1407
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1405
1408
|
}
|
|
1406
1409
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response */
|
|
1407
|
-
async editInteractionResponse(
|
|
1408
|
-
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), {
|
|
1409
1412
|
json: {
|
|
1410
1413
|
content: options.content,
|
|
1411
1414
|
embeds: options.embeds !== null
|
|
@@ -1447,7 +1450,7 @@ class Client extends node_events_1.default {
|
|
|
1447
1450
|
? {
|
|
1448
1451
|
question: options.poll.question,
|
|
1449
1452
|
answers: options.poll.answers.map((answer) => ({
|
|
1450
|
-
answer_id: answer.
|
|
1453
|
+
answer_id: answer.answerId,
|
|
1451
1454
|
poll_media: answer.pollMedia,
|
|
1452
1455
|
})),
|
|
1453
1456
|
duration: options.poll.duration,
|
|
@@ -1459,35 +1462,35 @@ class Client extends node_events_1.default {
|
|
|
1459
1462
|
},
|
|
1460
1463
|
files: options.files,
|
|
1461
1464
|
query: {
|
|
1462
|
-
thread_id: options.
|
|
1465
|
+
thread_id: options.threadId,
|
|
1463
1466
|
},
|
|
1464
1467
|
});
|
|
1465
1468
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1466
1469
|
}
|
|
1467
1470
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
|
1468
|
-
editUserVoiceState(
|
|
1469
|
-
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), {
|
|
1470
1473
|
json: {
|
|
1471
|
-
channel_id: options.
|
|
1474
|
+
channel_id: options.channelId,
|
|
1472
1475
|
suppress: options.suppress,
|
|
1473
1476
|
},
|
|
1474
1477
|
});
|
|
1475
1478
|
}
|
|
1476
1479
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook */
|
|
1477
|
-
async editWebhook(
|
|
1478
|
-
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), {
|
|
1479
1482
|
json: {
|
|
1480
1483
|
name: options.name,
|
|
1481
1484
|
avatar: options.avatar,
|
|
1482
|
-
channel_id: options.
|
|
1485
|
+
channel_id: options.channelId,
|
|
1483
1486
|
},
|
|
1484
1487
|
reason,
|
|
1485
1488
|
});
|
|
1486
1489
|
return transformers_1.Webhooks.webhookFromRaw(response);
|
|
1487
1490
|
}
|
|
1488
1491
|
/** https://discord.com/developers/docs/resources/webhook#edit-webhook-message */
|
|
1489
|
-
async editWebhookMessage(
|
|
1490
|
-
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), {
|
|
1491
1494
|
json: {
|
|
1492
1495
|
content: options.content,
|
|
1493
1496
|
embeds: options.embeds !== null
|
|
@@ -1529,7 +1532,7 @@ class Client extends node_events_1.default {
|
|
|
1529
1532
|
? {
|
|
1530
1533
|
question: options.poll.question,
|
|
1531
1534
|
answers: options.poll.answers.map((answer) => ({
|
|
1532
|
-
answer_id: answer.
|
|
1535
|
+
answer_id: answer.answerId,
|
|
1533
1536
|
poll_media: answer.pollMedia,
|
|
1534
1537
|
})),
|
|
1535
1538
|
duration: options.poll.duration,
|
|
@@ -1541,15 +1544,15 @@ class Client extends node_events_1.default {
|
|
|
1541
1544
|
},
|
|
1542
1545
|
files: options.files,
|
|
1543
1546
|
query: {
|
|
1544
|
-
thread_id: options.
|
|
1547
|
+
thread_id: options.threadId,
|
|
1545
1548
|
with_components: options.withComponents,
|
|
1546
1549
|
},
|
|
1547
1550
|
});
|
|
1548
1551
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1549
1552
|
}
|
|
1550
1553
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
|
1551
|
-
async editWebhookWithToken(
|
|
1552
|
-
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), {
|
|
1553
1556
|
json: {
|
|
1554
1557
|
name: options.name,
|
|
1555
1558
|
avatar: options.avatar,
|
|
@@ -1560,13 +1563,13 @@ class Client extends node_events_1.default {
|
|
|
1560
1563
|
return transformers_1.Webhooks.webhookFromRaw(response);
|
|
1561
1564
|
}
|
|
1562
1565
|
/** https://discord.com/developers/docs/resources/poll#end-poll */
|
|
1563
|
-
async endPoll(
|
|
1564
|
-
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));
|
|
1565
1568
|
return transformers_1.Messages.messageFromRaw(response);
|
|
1566
1569
|
}
|
|
1567
1570
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
|
1568
|
-
async executeWebhook(
|
|
1569
|
-
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), {
|
|
1570
1573
|
json: {
|
|
1571
1574
|
content: options.content,
|
|
1572
1575
|
username: options.username,
|
|
@@ -1592,7 +1595,7 @@ class Client extends node_events_1.default {
|
|
|
1592
1595
|
? {
|
|
1593
1596
|
question: options.poll.question,
|
|
1594
1597
|
answers: options.poll.answers.map((answer) => ({
|
|
1595
|
-
answer_id: answer.
|
|
1598
|
+
answer_id: answer.answerId,
|
|
1596
1599
|
poll_media: answer.pollMedia,
|
|
1597
1600
|
})),
|
|
1598
1601
|
duration: options.poll.duration,
|
|
@@ -1604,7 +1607,7 @@ class Client extends node_events_1.default {
|
|
|
1604
1607
|
files: options.files,
|
|
1605
1608
|
query: {
|
|
1606
1609
|
wait: options.wait,
|
|
1607
|
-
thread_id: options.
|
|
1610
|
+
thread_id: options.threadId,
|
|
1608
1611
|
with_components: options.withComponents,
|
|
1609
1612
|
},
|
|
1610
1613
|
});
|
|
@@ -1615,10 +1618,10 @@ class Client extends node_events_1.default {
|
|
|
1615
1618
|
*
|
|
1616
1619
|
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
|
|
1617
1620
|
*/
|
|
1618
|
-
async executeWebhookPlatform(
|
|
1619
|
-
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), {
|
|
1620
1623
|
query: {
|
|
1621
|
-
thread_id: options.
|
|
1624
|
+
thread_id: options.threadId,
|
|
1622
1625
|
wait: options.wait,
|
|
1623
1626
|
},
|
|
1624
1627
|
json: options,
|
|
@@ -1626,29 +1629,29 @@ class Client extends node_events_1.default {
|
|
|
1626
1629
|
return response !== null ? transformers_1.Messages.messageFromRaw(response) : null;
|
|
1627
1630
|
}
|
|
1628
1631
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
|
1629
|
-
async followChannel(
|
|
1630
|
-
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), {
|
|
1631
1634
|
json: {
|
|
1632
|
-
webhook_channel_id: options.
|
|
1635
|
+
webhook_channel_id: options.webhookChannelId,
|
|
1633
1636
|
},
|
|
1634
1637
|
reason,
|
|
1635
1638
|
});
|
|
1636
1639
|
return {
|
|
1637
|
-
|
|
1638
|
-
|
|
1640
|
+
channelId: response.channel_id,
|
|
1641
|
+
webhookId: response.webhook_id,
|
|
1639
1642
|
};
|
|
1640
1643
|
}
|
|
1641
1644
|
/** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
|
|
1642
|
-
async getActiveGuildThreads(
|
|
1643
|
-
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));
|
|
1644
1647
|
return {
|
|
1645
1648
|
threads: response.threads.map((thread) => transformers_1.Channels.channelFromRaw(thread)),
|
|
1646
1649
|
members: response.members.map((threadMember) => transformers_1.Channels.threadMemberFromRaw(threadMember)),
|
|
1647
1650
|
};
|
|
1648
1651
|
}
|
|
1649
1652
|
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
|
|
1650
|
-
async getArchivedThreads(
|
|
1651
|
-
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), {
|
|
1652
1655
|
query: {
|
|
1653
1656
|
before: options?.before,
|
|
1654
1657
|
limit: options?.limit,
|
|
@@ -1661,10 +1664,10 @@ class Client extends node_events_1.default {
|
|
|
1661
1664
|
};
|
|
1662
1665
|
}
|
|
1663
1666
|
/** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */
|
|
1664
|
-
async getAuditLog(
|
|
1665
|
-
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), {
|
|
1666
1669
|
query: {
|
|
1667
|
-
user_id: options?.
|
|
1670
|
+
user_id: options?.userId,
|
|
1668
1671
|
action_type: options?.actionType,
|
|
1669
1672
|
before: options?.before,
|
|
1670
1673
|
after: options?.after,
|
|
@@ -1674,71 +1677,71 @@ class Client extends node_events_1.default {
|
|
|
1674
1677
|
return transformers_1.AuditLogs.auditLogFromRaw(response);
|
|
1675
1678
|
}
|
|
1676
1679
|
/** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
|
|
1677
|
-
async getAutoModerationRule(
|
|
1678
|
-
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));
|
|
1679
1682
|
return transformers_1.AutoModeration.autoModerationRuleFromRaw(response);
|
|
1680
1683
|
}
|
|
1681
1684
|
/** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
|
|
1682
|
-
async getAutoModerationRules(
|
|
1683
|
-
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));
|
|
1684
1687
|
return response.map((autoModerationRule) => transformers_1.AutoModeration.autoModerationRuleFromRaw(autoModerationRule));
|
|
1685
1688
|
}
|
|
1686
1689
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-activity-instance */
|
|
1687
|
-
async getApplicationActivityInstance(
|
|
1688
|
-
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));
|
|
1689
1692
|
return {
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
+
applicationId: response.application_id,
|
|
1694
|
+
instanceId: response.instance_id,
|
|
1695
|
+
launchId: response.launch_id,
|
|
1693
1696
|
location: {
|
|
1694
1697
|
id: response.location.id,
|
|
1695
1698
|
kind: response.location.kind,
|
|
1696
|
-
|
|
1697
|
-
|
|
1699
|
+
channelId: response.location.channel_id,
|
|
1700
|
+
guildId: response.location.guild_id,
|
|
1698
1701
|
},
|
|
1699
1702
|
users: response.users,
|
|
1700
1703
|
};
|
|
1701
1704
|
}
|
|
1702
1705
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
|
1703
|
-
async getApplicationCommandPermissions(
|
|
1704
|
-
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));
|
|
1705
1708
|
return transformers_1.Guilds.guildApplicationCommandPermissionsFromRaw(response);
|
|
1706
1709
|
}
|
|
1707
1710
|
/** https://discord.com/developers/docs/resources/emoji#get-application-emoji */
|
|
1708
|
-
async getApplicationEmoji(
|
|
1709
|
-
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));
|
|
1710
1713
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
1711
1714
|
}
|
|
1712
1715
|
/** https://discord.com/developers/docs/resources/emoji#list-application-emojis */
|
|
1713
|
-
async getApplicationEmojis(
|
|
1714
|
-
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));
|
|
1715
1718
|
return {
|
|
1716
1719
|
items: response.items.map((emoji) => transformers_1.Emojis.emojiFromRaw(emoji)),
|
|
1717
1720
|
};
|
|
1718
1721
|
}
|
|
1719
1722
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
|
|
1720
|
-
async getApplicationRoleConnectionMetadataRecords(
|
|
1721
|
-
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));
|
|
1722
1725
|
return response.map((applicationRoleConnectionMetadata) => transformers_1.ApplicationRoleConnectionMetadatas.applicationRoleConnectionMetadataFromRaw(applicationRoleConnectionMetadata));
|
|
1723
1726
|
}
|
|
1724
1727
|
/** https://discord.com/developers/docs/resources/channel#get-channel */
|
|
1725
|
-
async getChannel(
|
|
1726
|
-
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));
|
|
1727
1730
|
return transformers_1.Channels.channelFromRaw(response);
|
|
1728
1731
|
}
|
|
1729
1732
|
/** https://discord.com/developers/docs/resources/guild#get-guild-channels */
|
|
1730
|
-
async getChannels(
|
|
1731
|
-
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));
|
|
1732
1735
|
return response.map((channel) => transformers_1.Channels.channelFromRaw(channel));
|
|
1733
1736
|
}
|
|
1734
1737
|
/** https://discord.com/developers/docs/resources/channel#get-channel-invites */
|
|
1735
|
-
async getChannelInvites(
|
|
1736
|
-
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));
|
|
1737
1740
|
return response.map((invite) => transformers_1.Invites.inviteFromRaw(invite));
|
|
1738
1741
|
}
|
|
1739
1742
|
/** https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */
|
|
1740
|
-
async getChannelWebhooks(
|
|
1741
|
-
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));
|
|
1742
1745
|
return response.map((webhook) => transformers_1.Webhooks.webhookFromRaw(webhook));
|
|
1743
1746
|
}
|
|
1744
1747
|
/** https://discord.com/developers/docs/resources/application#get-current-application */
|
|
@@ -1747,8 +1750,8 @@ class Client extends node_events_1.default {
|
|
|
1747
1750
|
return transformers_1.Applications.applicationFromRaw(response);
|
|
1748
1751
|
}
|
|
1749
1752
|
/** https://discord.com/developers/docs/resources/user#get-current-user-application-role-connection */
|
|
1750
|
-
async getCurrentApplicationRoleConnection(
|
|
1751
|
-
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));
|
|
1752
1755
|
return {
|
|
1753
1756
|
platformName: response.platform_name,
|
|
1754
1757
|
platformUsername: response.platform_username,
|
|
@@ -1756,8 +1759,8 @@ class Client extends node_events_1.default {
|
|
|
1756
1759
|
};
|
|
1757
1760
|
}
|
|
1758
1761
|
/** https://discord.com/developers/docs/resources/user#get-current-user-guild-member */
|
|
1759
|
-
async getCurrentGuildMember(
|
|
1760
|
-
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));
|
|
1761
1764
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
1762
1765
|
}
|
|
1763
1766
|
/** https://discord.com/developers/docs/resources/user#get-current-user-connections */
|
|
@@ -1777,8 +1780,8 @@ class Client extends node_events_1.default {
|
|
|
1777
1780
|
}));
|
|
1778
1781
|
}
|
|
1779
1782
|
/** https://discord.com/developers/docs/resources/voice#get-current-user-voice-state */
|
|
1780
|
-
async getCurrentUserVoiceState(
|
|
1781
|
-
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));
|
|
1782
1785
|
return transformers_1.Voice.voiceStateFromRaw(response);
|
|
1783
1786
|
}
|
|
1784
1787
|
/** https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds */
|
|
@@ -1787,20 +1790,20 @@ class Client extends node_events_1.default {
|
|
|
1787
1790
|
return response.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound));
|
|
1788
1791
|
}
|
|
1789
1792
|
/** https://discord.com/developers/docs/resources/entitlement#get-entitlement */
|
|
1790
|
-
async getEntitlement(
|
|
1791
|
-
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));
|
|
1792
1795
|
return transformers_1.Entitlements.entitlementFromRaw(response);
|
|
1793
1796
|
}
|
|
1794
1797
|
/** https://discord.com/developers/docs/resources/entitlement#list-entitlements */
|
|
1795
|
-
async getEntitlements(
|
|
1796
|
-
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), {
|
|
1797
1800
|
query: {
|
|
1798
|
-
user_id: options?.
|
|
1799
|
-
sku_ids: options?.
|
|
1801
|
+
user_id: options?.userId,
|
|
1802
|
+
sku_ids: options?.skuIds,
|
|
1800
1803
|
before: options?.before,
|
|
1801
1804
|
after: options?.after,
|
|
1802
1805
|
limit: options?.limit,
|
|
1803
|
-
guild_id: options?.
|
|
1806
|
+
guild_id: options?.guildId,
|
|
1804
1807
|
exclude_ended: options?.excludeEnded,
|
|
1805
1808
|
exclude_deleted: options?.excludeDeleted,
|
|
1806
1809
|
},
|
|
@@ -1826,13 +1829,13 @@ class Client extends node_events_1.default {
|
|
|
1826
1829
|
};
|
|
1827
1830
|
}
|
|
1828
1831
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
|
|
1829
|
-
async getGlobalApplicationCommand(
|
|
1830
|
-
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));
|
|
1831
1834
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
1832
1835
|
}
|
|
1833
1836
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
|
|
1834
|
-
async getGlobalApplicationCommands(
|
|
1835
|
-
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), {
|
|
1836
1839
|
query: {
|
|
1837
1840
|
with_localizations: options.withLocalizations,
|
|
1838
1841
|
},
|
|
@@ -1840,8 +1843,8 @@ class Client extends node_events_1.default {
|
|
|
1840
1843
|
return response.map((applicationCommand) => transformers_1.ApplicationCommands.applicationCommandFromRaw(applicationCommand));
|
|
1841
1844
|
}
|
|
1842
1845
|
/** https://discord.com/developers/docs/resources/guild#get-guild */
|
|
1843
|
-
async getGuild(
|
|
1844
|
-
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), {
|
|
1845
1848
|
query: {
|
|
1846
1849
|
with_counts: options?.withCounts,
|
|
1847
1850
|
},
|
|
@@ -1871,13 +1874,13 @@ class Client extends node_events_1.default {
|
|
|
1871
1874
|
}));
|
|
1872
1875
|
}
|
|
1873
1876
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
|
|
1874
|
-
async getGuildApplicationCommand(
|
|
1875
|
-
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));
|
|
1876
1879
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
1877
1880
|
}
|
|
1878
1881
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
|
|
1879
|
-
async getGuildApplicationCommands(
|
|
1880
|
-
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), {
|
|
1881
1884
|
query: {
|
|
1882
1885
|
with_localizations: options?.withLocalizations,
|
|
1883
1886
|
},
|
|
@@ -1885,21 +1888,21 @@ class Client extends node_events_1.default {
|
|
|
1885
1888
|
return response.map((applicationCommand) => transformers_1.ApplicationCommands.applicationCommandFromRaw(applicationCommand));
|
|
1886
1889
|
}
|
|
1887
1890
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
|
|
1888
|
-
async getGuildApplicationCommandPermissions(
|
|
1889
|
-
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));
|
|
1890
1893
|
return transformers_1.Guilds.guildApplicationCommandPermissionsFromRaw(response);
|
|
1891
1894
|
}
|
|
1892
1895
|
/** https://discord.com/developers/docs/resources/guild#get-guild-ban */
|
|
1893
|
-
async getGuildBan(
|
|
1894
|
-
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));
|
|
1895
1898
|
return {
|
|
1896
1899
|
reason: response.reason,
|
|
1897
1900
|
user: transformers_1.Users.userFromRaw(response.user),
|
|
1898
1901
|
};
|
|
1899
1902
|
}
|
|
1900
1903
|
/** https://discord.com/developers/docs/resources/guild#get-guild-bans */
|
|
1901
|
-
async getGuildBans(
|
|
1902
|
-
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), {
|
|
1903
1906
|
query: {
|
|
1904
1907
|
limit: options?.limit,
|
|
1905
1908
|
before: options?.before,
|
|
@@ -1912,33 +1915,33 @@ class Client extends node_events_1.default {
|
|
|
1912
1915
|
}));
|
|
1913
1916
|
}
|
|
1914
1917
|
/** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
|
|
1915
|
-
async getGuildEmoji(
|
|
1916
|
-
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));
|
|
1917
1920
|
return transformers_1.Emojis.emojiFromRaw(response);
|
|
1918
1921
|
}
|
|
1919
1922
|
/** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
|
|
1920
|
-
async getGuildEmojis(
|
|
1921
|
-
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));
|
|
1922
1925
|
return response.map((emoji) => transformers_1.Emojis.emojiFromRaw(emoji));
|
|
1923
1926
|
}
|
|
1924
1927
|
/** https://discord.com/developers/docs/resources/guild#get-guild-integrations */
|
|
1925
|
-
async getGuildIntegrations(
|
|
1926
|
-
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));
|
|
1927
1930
|
return response.map((integration) => transformers_1.Guilds.integrationFromRaw(integration));
|
|
1928
1931
|
}
|
|
1929
1932
|
/** https://discord.com/developers/docs/resources/guild#get-guild-invites */
|
|
1930
|
-
async getGuildInvites(
|
|
1931
|
-
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));
|
|
1932
1935
|
return response.map((invite) => transformers_1.Invites.inviteFromRaw(invite));
|
|
1933
1936
|
}
|
|
1934
1937
|
/** https://discord.com/developers/docs/resources/guild#get-guild-member */
|
|
1935
|
-
async getGuildMember(
|
|
1936
|
-
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));
|
|
1937
1940
|
return transformers_1.Guilds.guildMemberFromRaw(response);
|
|
1938
1941
|
}
|
|
1939
1942
|
/** https://discord.com/developers/docs/resources/guild#list-guild-members */
|
|
1940
|
-
async getGuildMembers(
|
|
1941
|
-
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), {
|
|
1942
1945
|
query: {
|
|
1943
1946
|
limit: options.limit,
|
|
1944
1947
|
after: options.after,
|
|
@@ -1947,21 +1950,21 @@ class Client extends node_events_1.default {
|
|
|
1947
1950
|
return response.map((guildMember) => transformers_1.Guilds.guildMemberFromRaw(guildMember));
|
|
1948
1951
|
}
|
|
1949
1952
|
/** https://discord.com/developers/docs/resources/guild#get-guild-onboarding */
|
|
1950
|
-
async getGuildOnboarding(
|
|
1951
|
-
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));
|
|
1952
1955
|
return {
|
|
1953
|
-
|
|
1956
|
+
guildId: response.guild_id,
|
|
1954
1957
|
prompts: response.prompts.map((prompt) => ({
|
|
1955
1958
|
id: prompt.id,
|
|
1956
1959
|
type: prompt.type,
|
|
1957
1960
|
options: prompt.options.map((promptOption) => ({
|
|
1958
1961
|
id: promptOption.id,
|
|
1959
|
-
|
|
1960
|
-
|
|
1962
|
+
channelIds: promptOption.channel_ids,
|
|
1963
|
+
roleIds: promptOption.role_ids,
|
|
1961
1964
|
emoji: promptOption.emoji !== undefined
|
|
1962
1965
|
? transformers_1.Emojis.emojiFromRaw(promptOption.emoji)
|
|
1963
1966
|
: undefined,
|
|
1964
|
-
|
|
1967
|
+
emojiId: promptOption.emoji_id,
|
|
1965
1968
|
emojiName: promptOption.emoji_name,
|
|
1966
1969
|
emojiAnimated: promptOption.emoji_animated,
|
|
1967
1970
|
title: promptOption.title,
|
|
@@ -1972,14 +1975,14 @@ class Client extends node_events_1.default {
|
|
|
1972
1975
|
required: prompt.required,
|
|
1973
1976
|
inOnboarding: prompt.in_onboarding,
|
|
1974
1977
|
})),
|
|
1975
|
-
|
|
1978
|
+
defaultChannelIds: response.default_channel_ids,
|
|
1976
1979
|
enabled: response.enabled,
|
|
1977
1980
|
mode: response.mode,
|
|
1978
1981
|
};
|
|
1979
1982
|
}
|
|
1980
1983
|
/** https://discord.com/developers/docs/resources/guild#get-guild-preview */
|
|
1981
|
-
async getGuildPreview(
|
|
1982
|
-
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));
|
|
1983
1986
|
return {
|
|
1984
1987
|
id: response.id,
|
|
1985
1988
|
name: response.name,
|
|
@@ -1995,8 +1998,8 @@ class Client extends node_events_1.default {
|
|
|
1995
1998
|
};
|
|
1996
1999
|
}
|
|
1997
2000
|
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
|
|
1998
|
-
getGuildPruneCount(
|
|
1999
|
-
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), {
|
|
2000
2003
|
query: {
|
|
2001
2004
|
days: options.days,
|
|
2002
2005
|
include_roles: options.includeRoles,
|
|
@@ -2004,18 +2007,18 @@ class Client extends node_events_1.default {
|
|
|
2004
2007
|
});
|
|
2005
2008
|
}
|
|
2006
2009
|
/** https://discord.com/developers/docs/resources/guild#get-guild-role */
|
|
2007
|
-
async getGuildRole(
|
|
2008
|
-
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));
|
|
2009
2012
|
return transformers_1.Roles.roleFromRaw(response);
|
|
2010
2013
|
}
|
|
2011
2014
|
/** https://discord.com/developers/docs/resources/guild#get-guild-roles */
|
|
2012
|
-
async getGuildRoles(
|
|
2013
|
-
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));
|
|
2014
2017
|
return response.map((role) => transformers_1.Roles.roleFromRaw(role));
|
|
2015
2018
|
}
|
|
2016
2019
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild */
|
|
2017
|
-
async getGuildScheduledEvents(
|
|
2018
|
-
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), {
|
|
2019
2022
|
query: {
|
|
2020
2023
|
with_user_count: options?.withUserCount,
|
|
2021
2024
|
},
|
|
@@ -2023,8 +2026,8 @@ class Client extends node_events_1.default {
|
|
|
2023
2026
|
return response.map((guildScheduledEvent) => transformers_1.GuildScheduledEvents.guildScheduledEventFromRaw(guildScheduledEvent));
|
|
2024
2027
|
}
|
|
2025
2028
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users */
|
|
2026
|
-
async getGuildScheduledEventUsers(
|
|
2027
|
-
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), {
|
|
2028
2031
|
query: {
|
|
2029
2032
|
limit: options?.limit,
|
|
2030
2033
|
with_member: options?.withMember,
|
|
@@ -2033,7 +2036,7 @@ class Client extends node_events_1.default {
|
|
|
2033
2036
|
},
|
|
2034
2037
|
});
|
|
2035
2038
|
return response.map((guildScheduledEventUser) => ({
|
|
2036
|
-
|
|
2039
|
+
guildScheduledEventId: guildScheduledEventUser.guild_scheduled_event_id,
|
|
2037
2040
|
user: transformers_1.Users.userFromRaw(guildScheduledEventUser.user),
|
|
2038
2041
|
member: guildScheduledEventUser.member !== undefined
|
|
2039
2042
|
? transformers_1.Guilds.guildMemberFromRaw(guildScheduledEventUser.member)
|
|
@@ -2041,43 +2044,43 @@ class Client extends node_events_1.default {
|
|
|
2041
2044
|
}));
|
|
2042
2045
|
}
|
|
2043
2046
|
/** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
|
|
2044
|
-
async getGuildSticker(
|
|
2045
|
-
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));
|
|
2046
2049
|
return transformers_1.Stickers.stickerFromRaw(response);
|
|
2047
2050
|
}
|
|
2048
2051
|
/** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
|
|
2049
|
-
async getGuildStickers(
|
|
2050
|
-
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));
|
|
2051
2054
|
return response.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker));
|
|
2052
2055
|
}
|
|
2053
2056
|
/** https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound */
|
|
2054
|
-
async getGuildSoundboardSound(
|
|
2055
|
-
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));
|
|
2056
2059
|
return transformers_1.Soundboards.soundboardSoundFromRaw(response);
|
|
2057
2060
|
}
|
|
2058
|
-
async getGuildSoundboardSounds(
|
|
2059
|
-
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));
|
|
2060
2063
|
return {
|
|
2061
2064
|
items: response.items.map((sound) => transformers_1.Soundboards.soundboardSoundFromRaw(sound)),
|
|
2062
2065
|
};
|
|
2063
2066
|
}
|
|
2064
2067
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
|
2065
|
-
async getGuildTemplate(
|
|
2066
|
-
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));
|
|
2067
2070
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
2068
2071
|
}
|
|
2069
2072
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-templates */
|
|
2070
|
-
async getGuildTemplates(
|
|
2071
|
-
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));
|
|
2072
2075
|
return response.map((guildTemplate) => transformers_1.GuildTemplates.guildTemplateFromRaw(guildTemplate));
|
|
2073
2076
|
}
|
|
2074
2077
|
/** https://discord.com/developers/docs/resources/guild#get-guild-vanity-url */
|
|
2075
|
-
getGuildVanityURL(
|
|
2076
|
-
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));
|
|
2077
2080
|
}
|
|
2078
2081
|
/** https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */
|
|
2079
|
-
async getGuildVoiceRegions(
|
|
2080
|
-
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));
|
|
2081
2084
|
return response.map((voiceRegion) => ({
|
|
2082
2085
|
id: voiceRegion.id,
|
|
2083
2086
|
name: voiceRegion.name,
|
|
@@ -2087,21 +2090,21 @@ class Client extends node_events_1.default {
|
|
|
2087
2090
|
}));
|
|
2088
2091
|
}
|
|
2089
2092
|
/** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
|
|
2090
|
-
async getGuildWelcomeScreen(
|
|
2091
|
-
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));
|
|
2092
2095
|
return {
|
|
2093
2096
|
description: response.description,
|
|
2094
2097
|
welcomeChannels: response.welcome_channels.map((welcomeScreenChannel) => ({
|
|
2095
|
-
|
|
2098
|
+
channelId: welcomeScreenChannel.channel_id,
|
|
2096
2099
|
description: welcomeScreenChannel.description,
|
|
2097
|
-
|
|
2100
|
+
emojiId: welcomeScreenChannel.emoji_id,
|
|
2098
2101
|
emojiName: welcomeScreenChannel.emoji_name,
|
|
2099
2102
|
})),
|
|
2100
2103
|
};
|
|
2101
2104
|
}
|
|
2102
2105
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget */
|
|
2103
|
-
async getGuildWidget(
|
|
2104
|
-
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));
|
|
2105
2108
|
return {
|
|
2106
2109
|
id: response.id,
|
|
2107
2110
|
name: response.name,
|
|
@@ -2112,35 +2115,35 @@ class Client extends node_events_1.default {
|
|
|
2112
2115
|
};
|
|
2113
2116
|
}
|
|
2114
2117
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
|
|
2115
|
-
getGuildWidgetImage(
|
|
2116
|
-
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), {
|
|
2117
2120
|
query: {
|
|
2118
2121
|
style: options?.style,
|
|
2119
2122
|
},
|
|
2120
2123
|
});
|
|
2121
2124
|
}
|
|
2122
2125
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-settings */
|
|
2123
|
-
async getGuildWidgetSettings(
|
|
2124
|
-
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));
|
|
2125
2128
|
return {
|
|
2126
2129
|
enabled: response.enabled,
|
|
2127
|
-
|
|
2130
|
+
channelId: response.channel_id,
|
|
2128
2131
|
};
|
|
2129
2132
|
}
|
|
2130
2133
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message */
|
|
2131
|
-
async getInteractionFollowupMessage(
|
|
2132
|
-
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), {
|
|
2133
2136
|
query: {
|
|
2134
|
-
thread_id: options?.
|
|
2137
|
+
thread_id: options?.threadId,
|
|
2135
2138
|
},
|
|
2136
2139
|
});
|
|
2137
2140
|
return transformers_1.Messages.messageFromRaw(response);
|
|
2138
2141
|
}
|
|
2139
2142
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response */
|
|
2140
|
-
async getInteractionResponse(
|
|
2141
|
-
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), {
|
|
2142
2145
|
query: {
|
|
2143
|
-
thread_id: options?.
|
|
2146
|
+
thread_id: options?.threadId,
|
|
2144
2147
|
},
|
|
2145
2148
|
});
|
|
2146
2149
|
return transformers_1.Messages.messageFromRaw(response);
|
|
@@ -2150,14 +2153,14 @@ class Client extends node_events_1.default {
|
|
|
2150
2153
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.invite(code), {
|
|
2151
2154
|
query: {
|
|
2152
2155
|
with_counts: options?.withCounts,
|
|
2153
|
-
guild_scheduled_event_id: options?.
|
|
2156
|
+
guild_scheduled_event_id: options?.guildScheduledEventId,
|
|
2154
2157
|
},
|
|
2155
2158
|
});
|
|
2156
2159
|
return transformers_1.Invites.inviteFromRaw(response);
|
|
2157
2160
|
}
|
|
2158
2161
|
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
|
2159
|
-
async getJoinedPrivateArchivedThreads(
|
|
2160
|
-
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), {
|
|
2161
2164
|
query: {
|
|
2162
2165
|
before: options?.before,
|
|
2163
2166
|
limit: options?.limit,
|
|
@@ -2170,18 +2173,18 @@ class Client extends node_events_1.default {
|
|
|
2170
2173
|
};
|
|
2171
2174
|
}
|
|
2172
2175
|
/** https://discord.com/developers/docs/resources/lobby#get-lobby */
|
|
2173
|
-
async getLobby(
|
|
2174
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(
|
|
2176
|
+
async getLobby(lobbyId) {
|
|
2177
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(lobbyId));
|
|
2175
2178
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2176
2179
|
}
|
|
2177
2180
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
2178
|
-
async getMessage(
|
|
2179
|
-
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));
|
|
2180
2183
|
return transformers_1.Messages.messageFromRaw(response);
|
|
2181
2184
|
}
|
|
2182
2185
|
/** https://discord.com/developers/docs/resources/message#get-reactions */
|
|
2183
|
-
async getMessageReactions(
|
|
2184
|
-
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), {
|
|
2185
2188
|
query: {
|
|
2186
2189
|
type: options?.type,
|
|
2187
2190
|
after: options?.after,
|
|
@@ -2191,8 +2194,8 @@ class Client extends node_events_1.default {
|
|
|
2191
2194
|
return response.map((user) => transformers_1.Users.userFromRaw(user));
|
|
2192
2195
|
}
|
|
2193
2196
|
/** https://discord.com/developers/docs/resources/message#get-channel-messages */
|
|
2194
|
-
async getMessages(
|
|
2195
|
-
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), {
|
|
2196
2199
|
query: {
|
|
2197
2200
|
around: options.around,
|
|
2198
2201
|
before: options.before,
|
|
@@ -2220,8 +2223,8 @@ class Client extends node_events_1.default {
|
|
|
2220
2223
|
};
|
|
2221
2224
|
}
|
|
2222
2225
|
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
|
2223
|
-
async getPinnedMessages(
|
|
2224
|
-
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), {
|
|
2225
2228
|
query: options,
|
|
2226
2229
|
});
|
|
2227
2230
|
return {
|
|
@@ -2233,8 +2236,8 @@ class Client extends node_events_1.default {
|
|
|
2233
2236
|
};
|
|
2234
2237
|
}
|
|
2235
2238
|
/** https://discord.com/developers/docs/resources/poll#get-answer-voters */
|
|
2236
|
-
async getPollAnswerVoters(
|
|
2237
|
-
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), {
|
|
2238
2241
|
query: {
|
|
2239
2242
|
after: options?.after,
|
|
2240
2243
|
limit: options?.limit,
|
|
@@ -2245,43 +2248,43 @@ class Client extends node_events_1.default {
|
|
|
2245
2248
|
};
|
|
2246
2249
|
}
|
|
2247
2250
|
/** https://discord.com/developers/docs/resources/sku#list-skus */
|
|
2248
|
-
async getSKUs(
|
|
2249
|
-
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));
|
|
2250
2253
|
return response.map((sku) => transformers_1.SKUs.skuFromRaw(sku));
|
|
2251
2254
|
}
|
|
2252
2255
|
/** https://discord.com/developers/docs/resources/subscription#get-sku-subscription */
|
|
2253
|
-
async getSKUSubscription(
|
|
2254
|
-
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));
|
|
2255
2258
|
return transformers_1.Subscriptions.subscriptionFromRaw(response);
|
|
2256
2259
|
}
|
|
2257
2260
|
/** https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions */
|
|
2258
|
-
async getSKUSubscriptions(
|
|
2259
|
-
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), {
|
|
2260
2263
|
query: {
|
|
2261
2264
|
before: options.before,
|
|
2262
2265
|
after: options.after,
|
|
2263
2266
|
limit: options.limit,
|
|
2264
|
-
user_id: options.
|
|
2267
|
+
user_id: options.userId,
|
|
2265
2268
|
},
|
|
2266
2269
|
});
|
|
2267
2270
|
return response.map((subscription) => transformers_1.Subscriptions.subscriptionFromRaw(subscription));
|
|
2268
2271
|
}
|
|
2269
2272
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
|
2270
|
-
async getStageInstance(
|
|
2271
|
-
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));
|
|
2272
2275
|
return transformers_1.StageInstances.stageInstanceFromRaw(response);
|
|
2273
2276
|
}
|
|
2274
2277
|
/** https://discord.com/developers/docs/resources/sticker#get-sticker-pack */
|
|
2275
|
-
async getStickerPack(
|
|
2276
|
-
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));
|
|
2277
2280
|
return {
|
|
2278
2281
|
id: response.id,
|
|
2279
2282
|
stickers: response.stickers.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker)),
|
|
2280
2283
|
name: response.name,
|
|
2281
|
-
|
|
2282
|
-
|
|
2284
|
+
skuId: response.sku_id,
|
|
2285
|
+
coverStickerId: response.cover_sticker_id,
|
|
2283
2286
|
description: response.description,
|
|
2284
|
-
|
|
2287
|
+
bannerAssetId: response.banner_asset_id,
|
|
2285
2288
|
};
|
|
2286
2289
|
}
|
|
2287
2290
|
/** https://discord.com/developers/docs/resources/sticker#list-sticker-packs */
|
|
@@ -2292,16 +2295,16 @@ class Client extends node_events_1.default {
|
|
|
2292
2295
|
id: stickerPack.id,
|
|
2293
2296
|
stickers: stickerPack.stickers.map((sticker) => transformers_1.Stickers.stickerFromRaw(sticker)),
|
|
2294
2297
|
name: stickerPack.name,
|
|
2295
|
-
|
|
2296
|
-
|
|
2298
|
+
skuId: stickerPack.sku_id,
|
|
2299
|
+
coverStickerId: stickerPack.cover_sticker_id,
|
|
2297
2300
|
description: stickerPack.description,
|
|
2298
|
-
|
|
2301
|
+
bannerAssetId: stickerPack.banner_asset_id,
|
|
2299
2302
|
})),
|
|
2300
2303
|
};
|
|
2301
2304
|
}
|
|
2302
2305
|
/** https://discord.com/developers/docs/resources/channel#get-thread-member */
|
|
2303
|
-
async getThreadMember(
|
|
2304
|
-
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), {
|
|
2305
2308
|
query: {
|
|
2306
2309
|
with_member: options?.withMember,
|
|
2307
2310
|
},
|
|
@@ -2309,8 +2312,8 @@ class Client extends node_events_1.default {
|
|
|
2309
2312
|
return transformers_1.Channels.threadMemberFromRaw(response);
|
|
2310
2313
|
}
|
|
2311
2314
|
/** https://discord.com/developers/docs/resources/channel#list-thread-members */
|
|
2312
|
-
async getThreadMembers(
|
|
2313
|
-
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), {
|
|
2314
2317
|
query: {
|
|
2315
2318
|
with_member: options?.withMember,
|
|
2316
2319
|
after: options?.after,
|
|
@@ -2320,8 +2323,8 @@ class Client extends node_events_1.default {
|
|
|
2320
2323
|
return response.map((threadMember) => transformers_1.Channels.threadMemberFromRaw(threadMember));
|
|
2321
2324
|
}
|
|
2322
2325
|
/** https://discord.com/developers/docs/resources/user#get-user */
|
|
2323
|
-
async getUser(
|
|
2324
|
-
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));
|
|
2325
2328
|
return transformers_1.Users.userFromRaw(response);
|
|
2326
2329
|
}
|
|
2327
2330
|
/** https://discord.com/developers/docs/resources/voice#list-voice-regions */
|
|
@@ -2336,106 +2339,110 @@ class Client extends node_events_1.default {
|
|
|
2336
2339
|
}));
|
|
2337
2340
|
}
|
|
2338
2341
|
/** https://discord.com/developers/docs/resources/voice#get-user-voice-state */
|
|
2339
|
-
async getUserVoiceState(
|
|
2340
|
-
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));
|
|
2341
2344
|
return transformers_1.Voice.voiceStateFromRaw(response);
|
|
2342
2345
|
}
|
|
2343
2346
|
/** https://discord.com/developers/docs/resources/webhook#get-webhook-message */
|
|
2344
|
-
async getWebhookMessage(
|
|
2345
|
-
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), {
|
|
2346
2349
|
query: {
|
|
2347
|
-
thread_id: options?.
|
|
2350
|
+
thread_id: options?.threadId,
|
|
2348
2351
|
},
|
|
2349
2352
|
});
|
|
2350
2353
|
return transformers_1.Messages.messageFromRaw(response);
|
|
2351
2354
|
}
|
|
2352
2355
|
/** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
|
|
2353
|
-
async getWebhooks(
|
|
2354
|
-
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));
|
|
2355
2358
|
return response.map((webhook) => transformers_1.Webhooks.webhookFromRaw(webhook));
|
|
2356
2359
|
}
|
|
2357
2360
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
|
2358
|
-
joinThread(
|
|
2359
|
-
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));
|
|
2360
2363
|
}
|
|
2361
2364
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
2362
|
-
joinVoiceChannel(
|
|
2363
|
-
this.shards
|
|
2364
|
-
|
|
2365
|
-
|
|
2365
|
+
joinVoiceChannel(guildId, channelId, options) {
|
|
2366
|
+
this.shards
|
|
2367
|
+
.get(this.guildShardMap.get(guildId))
|
|
2368
|
+
.transmitter.updateVoiceState({
|
|
2369
|
+
guildId,
|
|
2370
|
+
channelId,
|
|
2366
2371
|
selfMute: !!options?.selfMute,
|
|
2367
2372
|
selfDeaf: !!options?.selfDeaf,
|
|
2368
2373
|
});
|
|
2369
2374
|
}
|
|
2370
2375
|
/** https://discord.com/developers/docs/resources/user#leave-guild */
|
|
2371
|
-
leaveGuild(
|
|
2372
|
-
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));
|
|
2373
2378
|
}
|
|
2374
2379
|
/** https://discord.com/developers/docs/resources/lobby#leave-lobby */
|
|
2375
|
-
leaveLobby(
|
|
2376
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(
|
|
2380
|
+
leaveLobby(lobbyId) {
|
|
2381
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyId));
|
|
2377
2382
|
}
|
|
2378
2383
|
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
|
2379
|
-
leaveThread(
|
|
2380
|
-
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"));
|
|
2381
2386
|
}
|
|
2382
2387
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
2383
|
-
leaveVoiceChannel(
|
|
2384
|
-
this.shards
|
|
2385
|
-
|
|
2386
|
-
|
|
2388
|
+
leaveVoiceChannel(guildId) {
|
|
2389
|
+
this.shards
|
|
2390
|
+
.get(this.guildShardMap.get(guildId))
|
|
2391
|
+
.transmitter.updateVoiceState({
|
|
2392
|
+
guildId,
|
|
2393
|
+
channelId: null,
|
|
2387
2394
|
selfMute: false,
|
|
2388
2395
|
selfDeaf: false,
|
|
2389
2396
|
});
|
|
2390
2397
|
}
|
|
2391
2398
|
/** discord.com/developers/docs/resources/lobby#link-channel-to-lobby */
|
|
2392
|
-
async linkChannel(
|
|
2393
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(
|
|
2399
|
+
async linkChannel(lobbyId, options) {
|
|
2400
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyId), {
|
|
2394
2401
|
json: {
|
|
2395
|
-
channel_id: options.
|
|
2402
|
+
channel_id: options.channelId,
|
|
2396
2403
|
},
|
|
2397
2404
|
});
|
|
2398
2405
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2399
2406
|
}
|
|
2400
2407
|
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
|
2401
|
-
pinMessage(
|
|
2402
|
-
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), {
|
|
2403
2410
|
reason,
|
|
2404
2411
|
});
|
|
2405
2412
|
}
|
|
2406
2413
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
|
|
2407
|
-
removeBan(
|
|
2408
|
-
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), {
|
|
2409
2416
|
reason,
|
|
2410
2417
|
});
|
|
2411
2418
|
}
|
|
2412
2419
|
/** https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient */
|
|
2413
|
-
removeGroupRecipient(
|
|
2414
|
-
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));
|
|
2415
2422
|
}
|
|
2416
2423
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member */
|
|
2417
|
-
removeGuildMember(
|
|
2418
|
-
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), {
|
|
2419
2426
|
reason,
|
|
2420
2427
|
});
|
|
2421
2428
|
}
|
|
2422
2429
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
|
2423
|
-
removeGuildMemberRole(
|
|
2424
|
-
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), {
|
|
2425
2432
|
reason,
|
|
2426
2433
|
});
|
|
2427
2434
|
}
|
|
2428
2435
|
/** https://discord.com/developers/docs/resources/lobby#remove-a-member-from-a-lobby */
|
|
2429
|
-
removeLobbyMember(
|
|
2430
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(
|
|
2436
|
+
removeLobbyMember(lobbyId, userId) {
|
|
2437
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyId, userId));
|
|
2431
2438
|
}
|
|
2432
2439
|
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
|
2433
|
-
removeThreadMember(
|
|
2434
|
-
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));
|
|
2435
2442
|
}
|
|
2436
2443
|
/** https://discord.com/developers/docs/resources/guild#search-guild-members */
|
|
2437
|
-
async searchGuildMembers(
|
|
2438
|
-
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), {
|
|
2439
2446
|
query: {
|
|
2440
2447
|
query: options.query,
|
|
2441
2448
|
limit: options.limit,
|
|
@@ -2444,40 +2451,40 @@ class Client extends node_events_1.default {
|
|
|
2444
2451
|
return response.map((guildMember) => transformers_1.Guilds.guildMemberFromRaw(guildMember));
|
|
2445
2452
|
}
|
|
2446
2453
|
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
|
2447
|
-
sendSoundboardSound(
|
|
2448
|
-
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), {
|
|
2449
2456
|
json: {
|
|
2450
|
-
sound_id: options.
|
|
2451
|
-
source_guild_id: options.
|
|
2457
|
+
sound_id: options.soundId,
|
|
2458
|
+
source_guild_id: options.sourceGuildId,
|
|
2452
2459
|
},
|
|
2453
2460
|
});
|
|
2454
2461
|
}
|
|
2455
2462
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
|
2456
2463
|
setPresence(options) {
|
|
2457
|
-
this.shards.forEach((shard) => shard.updatePresence(options));
|
|
2464
|
+
this.shards.forEach((shard) => shard.transmitter.updatePresence(options));
|
|
2458
2465
|
}
|
|
2459
2466
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
|
2460
|
-
async syncGuildTemplate(
|
|
2461
|
-
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));
|
|
2462
2469
|
return transformers_1.GuildTemplates.guildTemplateFromRaw(response);
|
|
2463
2470
|
}
|
|
2464
2471
|
/** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
|
|
2465
|
-
triggerTypingIndicator(
|
|
2466
|
-
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));
|
|
2467
2474
|
}
|
|
2468
2475
|
/** https://discord.com/developers/docs/resources/lobby#unlink-channel-from-lobby */
|
|
2469
|
-
async unlinkChannel(
|
|
2470
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(
|
|
2476
|
+
async unlinkChannel(lobbyId) {
|
|
2477
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyId));
|
|
2471
2478
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2472
2479
|
}
|
|
2473
2480
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
|
2474
|
-
async updateApplicationRoleConnectionMetadataRecords(
|
|
2475
|
-
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));
|
|
2476
2483
|
return response.map((applicationRoleConnectionMetadata) => transformers_1.ApplicationRoleConnectionMetadatas.applicationRoleConnectionMetadataFromRaw(applicationRoleConnectionMetadata));
|
|
2477
2484
|
}
|
|
2478
2485
|
/** https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection */
|
|
2479
|
-
async updateCurrentApplicationRoleConnection(
|
|
2480
|
-
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), {
|
|
2481
2488
|
json: {
|
|
2482
2489
|
platform_name: options.platformName,
|
|
2483
2490
|
platform_username: options.platformUsername,
|
|
@@ -2493,8 +2500,8 @@ class Client extends node_events_1.default {
|
|
|
2493
2500
|
};
|
|
2494
2501
|
}
|
|
2495
2502
|
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
|
2496
|
-
unpinMessage(
|
|
2497
|
-
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), {
|
|
2498
2505
|
reason,
|
|
2499
2506
|
});
|
|
2500
2507
|
}
|