disgroove 2.2.1-dev.d0eed5e → 2.2.1-dev.efad41d
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/dist/lib/Client.d.ts +220 -220
- package/dist/lib/Client.js +400 -400
- package/dist/lib/constants.d.ts +4 -4
- package/dist/lib/constants.js +4 -4
- package/dist/lib/gateway/Shard.d.ts +1 -1
- package/dist/lib/gateway/Shard.js +70 -70
- package/dist/lib/rest/CDN.d.ts +20 -20
- package/dist/lib/rest/CDN.js +20 -20
- package/dist/lib/rest/Endpoints.d.ts +81 -81
- package/dist/lib/rest/Endpoints.js +91 -91
- package/dist/lib/types/application-command.d.ts +4 -4
- package/dist/lib/types/application.d.ts +2 -2
- package/dist/lib/types/audit-log.d.ts +5 -5
- package/dist/lib/types/auto-moderation.d.ts +3 -3
- package/dist/lib/types/channel.d.ts +23 -21
- package/dist/lib/types/entitlements.d.ts +6 -6
- package/dist/lib/types/gateway-events.d.ts +69 -69
- package/dist/lib/types/guild-scheduled-event.d.ts +5 -5
- package/dist/lib/types/guild-template.d.ts +2 -2
- package/dist/lib/types/guild.d.ts +17 -17
- package/dist/lib/types/interaction.d.ts +8 -8
- package/dist/lib/types/message-components.d.ts +4 -4
- package/dist/lib/types/poll.d.ts +1 -1
- package/dist/lib/types/role.d.ts +3 -3
- package/dist/lib/types/sku.d.ts +2 -2
- package/dist/lib/types/stage-instance.d.ts +3 -3
- package/dist/lib/types/sticker.d.ts +5 -5
- package/dist/lib/types/team.d.ts +2 -2
- package/dist/lib/types/user.d.ts +1 -1
- package/dist/lib/types/voice.d.ts +4 -4
- package/dist/lib/types/webhook.d.ts +3 -3
- package/dist/lib/utils/Util.d.ts +2 -2
- package/dist/lib/utils/Util.js +195 -193
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/lib/Client.js
CHANGED
@@ -39,8 +39,8 @@ class Client extends node_events_1.default {
|
|
39
39
|
this.guilds = new Map();
|
40
40
|
}
|
41
41
|
/** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient */
|
42
|
-
addGroupRecipient(
|
43
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelRecipient(
|
42
|
+
addGroupRecipient(channelID, userID, options) {
|
43
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelRecipient(channelID, userID), {
|
44
44
|
json: {
|
45
45
|
access_token: options.accessToken,
|
46
46
|
nick: options.nick,
|
@@ -48,8 +48,8 @@ class Client extends node_events_1.default {
|
|
48
48
|
});
|
49
49
|
}
|
50
50
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member */
|
51
|
-
async addGuildMember(
|
52
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildMember(
|
51
|
+
async addGuildMember(guildID, userID, options) {
|
52
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildMember(guildID, userID), {
|
53
53
|
json: {
|
54
54
|
access_token: options.accessToken,
|
55
55
|
nick: options.nick,
|
@@ -61,18 +61,18 @@ class Client extends node_events_1.default {
|
|
61
61
|
return response !== null ? this.util.guildMemberFromRaw(response) : null;
|
62
62
|
}
|
63
63
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
|
64
|
-
addGuildMemberRole(
|
65
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildMemberRole(
|
64
|
+
addGuildMemberRole(guildID, userID, roleID, reason) {
|
65
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildMemberRole(guildID, userID, roleID), {
|
66
66
|
reason,
|
67
67
|
});
|
68
68
|
}
|
69
69
|
/** https://discord.com/developers/docs/resources/channel#add-thread-member */
|
70
|
-
addThreadMember(
|
71
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(
|
70
|
+
addThreadMember(channelID, userID) {
|
71
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelID, userID));
|
72
72
|
}
|
73
73
|
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
|
74
|
-
beginGuildPrune(
|
75
|
-
return this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildPrune(
|
74
|
+
beginGuildPrune(guildID, options, reason) {
|
75
|
+
return this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildPrune(guildID), {
|
76
76
|
json: {
|
77
77
|
days: options.days,
|
78
78
|
compute_prune_count: options.computePruneCount,
|
@@ -83,10 +83,10 @@ class Client extends node_events_1.default {
|
|
83
83
|
});
|
84
84
|
}
|
85
85
|
/** https://discord.com/developers/docs/resources/guild#bulk-guild-ban */
|
86
|
-
async bulkGuildBan(
|
87
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.bulkGuildBan(
|
86
|
+
async bulkGuildBan(guildID, options, reason) {
|
87
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.bulkGuildBan(guildID), {
|
88
88
|
json: {
|
89
|
-
user_ids: options.
|
89
|
+
user_ids: options.userIDs,
|
90
90
|
delete_message_seconds: options.deleteMessageSeconds,
|
91
91
|
},
|
92
92
|
reason,
|
@@ -97,8 +97,8 @@ class Client extends node_events_1.default {
|
|
97
97
|
};
|
98
98
|
}
|
99
99
|
/** https://discord.com/developers/docs/resources/channel#bulk-delete-messages */
|
100
|
-
bulkDeleteMessages(
|
101
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelBulkDelete(
|
100
|
+
bulkDeleteMessages(channelID, options, reason) {
|
101
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelBulkDelete(channelID), {
|
102
102
|
json: {
|
103
103
|
messages: options?.messages,
|
104
104
|
},
|
@@ -106,15 +106,15 @@ class Client extends node_events_1.default {
|
|
106
106
|
});
|
107
107
|
}
|
108
108
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
|
109
|
-
async bulkEditGlobalApplicationCommands(
|
110
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommands(
|
109
|
+
async bulkEditGlobalApplicationCommands(applicationID, commands) {
|
110
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommands(applicationID), {
|
111
111
|
json: commands.map((command) => this.util.partialApplicationCommandToRaw(command)),
|
112
112
|
});
|
113
113
|
return response.map((c) => this.util.applicationCommandFromRaw(c));
|
114
114
|
}
|
115
115
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
|
116
|
-
async bulkEditGuildApplicationCommands(
|
117
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationGuildCommands(
|
116
|
+
async bulkEditGuildApplicationCommands(applicationID, guildID, commands) {
|
117
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationGuildCommands(applicationID, guildID), {
|
118
118
|
json: commands.map((command) => this.util.partialApplicationCommandToRaw(command)),
|
119
119
|
});
|
120
120
|
return response.map((c) => this.util.applicationCommandFromRaw(c));
|
@@ -130,12 +130,12 @@ class Client extends node_events_1.default {
|
|
130
130
|
this.shards.connect();
|
131
131
|
}
|
132
132
|
/** https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement */
|
133
|
-
consumeEntitlement(
|
134
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlementConsume(
|
133
|
+
consumeEntitlement(applicationID, entitlementID) {
|
134
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlementConsume(applicationID, entitlementID));
|
135
135
|
}
|
136
136
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
137
|
-
async createAutoModerationRule(
|
138
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildAutoModerationRules(
|
137
|
+
async createAutoModerationRule(guildID, options, reason) {
|
138
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildAutoModerationRules(guildID), {
|
139
139
|
json: {
|
140
140
|
name: options.name,
|
141
141
|
event_type: options.eventType,
|
@@ -144,7 +144,7 @@ class Client extends node_events_1.default {
|
|
144
144
|
actions: options.actions.map((action) => ({
|
145
145
|
type: action.type,
|
146
146
|
metadata: {
|
147
|
-
channel_id: action.metadata.
|
147
|
+
channel_id: action.metadata.channelID,
|
148
148
|
duration_seconds: action.metadata.durationSeconds,
|
149
149
|
custom_message: action.metadata.customMessage,
|
150
150
|
},
|
@@ -158,8 +158,8 @@ class Client extends node_events_1.default {
|
|
158
158
|
return this.util.autoModerationRuleFromRaw(response);
|
159
159
|
}
|
160
160
|
/** https://discord.com/developers/docs/resources/guild#create-guild-channel */
|
161
|
-
async createChannel(
|
162
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildChannels(
|
161
|
+
async createChannel(guildID, options, reason) {
|
162
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildChannels(guildID), {
|
163
163
|
json: {
|
164
164
|
name: options.name,
|
165
165
|
type: options.type,
|
@@ -169,7 +169,7 @@ class Client extends node_events_1.default {
|
|
169
169
|
rate_limit_per_user: options.rateLimitPerUser,
|
170
170
|
position: options.position,
|
171
171
|
permission_overwrites: options.permissionOverwrites,
|
172
|
-
parent_id: options.
|
172
|
+
parent_id: options.parentID,
|
173
173
|
nsfw: options.nsfw,
|
174
174
|
rtc_region: options.rtcRegion,
|
175
175
|
video_quality_mode: options.videoQualityMode,
|
@@ -177,7 +177,7 @@ class Client extends node_events_1.default {
|
|
177
177
|
default_reaction_emoji: options.defaultReactionEmoji !== undefined
|
178
178
|
? options.defaultReactionEmoji !== null
|
179
179
|
? {
|
180
|
-
emoji_id: options.defaultReactionEmoji.
|
180
|
+
emoji_id: options.defaultReactionEmoji.emojiID,
|
181
181
|
emoji_name: options.defaultReactionEmoji.emojiName,
|
182
182
|
}
|
183
183
|
: null
|
@@ -192,24 +192,24 @@ class Client extends node_events_1.default {
|
|
192
192
|
return this.util.channelFromRaw(response);
|
193
193
|
}
|
194
194
|
/** https://discord.com/developers/docs/resources/channel#create-channel-invite */
|
195
|
-
async createChannelInvite(
|
196
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelInvites(
|
195
|
+
async createChannelInvite(channelID, options, reason) {
|
196
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelInvites(channelID), {
|
197
197
|
json: {
|
198
198
|
max_age: options.maxAge,
|
199
199
|
max_uses: options.maxUses,
|
200
200
|
temporary: options.temporary,
|
201
201
|
unique: options.unique,
|
202
202
|
target_type: options.targetType,
|
203
|
-
target_user_id: options.
|
204
|
-
target_application_id: options.
|
203
|
+
target_user_id: options.targetUserID,
|
204
|
+
target_application_id: options.targetApplicationID,
|
205
205
|
},
|
206
206
|
reason,
|
207
207
|
});
|
208
208
|
return this.util.inviteFromRaw(response);
|
209
209
|
}
|
210
210
|
/** https://discord.com/developers/docs/resources/webhook#create-webhook */
|
211
|
-
async createChannelWebhook(
|
212
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelWebhooks(
|
211
|
+
async createChannelWebhook(channelID, options, reason) {
|
212
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelWebhooks(channelID), {
|
213
213
|
json: {
|
214
214
|
name: options.name,
|
215
215
|
avatar: options.avatar,
|
@@ -222,14 +222,14 @@ class Client extends node_events_1.default {
|
|
222
222
|
async createDM(options) {
|
223
223
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.userChannels(), {
|
224
224
|
json: {
|
225
|
-
recipient_id: options.
|
225
|
+
recipient_id: options.recipientID,
|
226
226
|
},
|
227
227
|
});
|
228
228
|
return this.util.channelFromRaw(response);
|
229
229
|
}
|
230
230
|
/** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
|
231
|
-
async createGlobalApplicationCommand(
|
232
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationCommands(
|
231
|
+
async createGlobalApplicationCommand(applicationID, options) {
|
232
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationCommands(applicationID), {
|
233
233
|
json: this.util.partialApplicationCommandToRaw(options),
|
234
234
|
});
|
235
235
|
return this.util.applicationCommandFromRaw(response);
|
@@ -263,24 +263,24 @@ class Client extends node_events_1.default {
|
|
263
263
|
permissions: role.permissions,
|
264
264
|
mentionable: role.mentionable,
|
265
265
|
})),
|
266
|
-
afk_channel_id: options.
|
266
|
+
afk_channel_id: options.afkChannelID,
|
267
267
|
afk_timeout: options.afkTimeout,
|
268
|
-
system_channel_id: options.
|
268
|
+
system_channel_id: options.systemChannelID,
|
269
269
|
system_channel_flags: options.systemChannelFlags,
|
270
270
|
},
|
271
271
|
});
|
272
272
|
return this.util.guildFromRaw(response);
|
273
273
|
}
|
274
274
|
/** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
|
275
|
-
async createGuildApplicationCommand(
|
276
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationGuildCommands(
|
275
|
+
async createGuildApplicationCommand(applicationID, guildID, options) {
|
276
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationGuildCommands(applicationID, guildID), {
|
277
277
|
json: this.util.partialApplicationCommandToRaw(options),
|
278
278
|
});
|
279
279
|
return this.util.applicationCommandFromRaw(response);
|
280
280
|
}
|
281
281
|
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
|
282
|
-
createGuildBan(
|
283
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildBan(
|
282
|
+
createGuildBan(guildID, userID, options, reason) {
|
283
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildBan(guildID, userID), {
|
284
284
|
json: {
|
285
285
|
delete_message_days: options?.deleteMessageDays,
|
286
286
|
delete_message_seconds: options?.deleteMessageSeconds,
|
@@ -289,8 +289,8 @@ class Client extends node_events_1.default {
|
|
289
289
|
});
|
290
290
|
}
|
291
291
|
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
|
292
|
-
async createGuildEmoji(
|
293
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildEmojis(
|
292
|
+
async createGuildEmoji(guildID, options, reason) {
|
293
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildEmojis(guildID), {
|
294
294
|
json: {
|
295
295
|
name: options.name,
|
296
296
|
image: options.image,
|
@@ -311,8 +311,8 @@ class Client extends node_events_1.default {
|
|
311
311
|
return this.util.guildFromRaw(response);
|
312
312
|
}
|
313
313
|
/** https://discord.com/developers/docs/resources/guild#create-guild-role */
|
314
|
-
async createGuildRole(
|
315
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildRoles(
|
314
|
+
async createGuildRole(guildID, options, reason) {
|
315
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildRoles(guildID), {
|
316
316
|
json: {
|
317
317
|
name: options.name,
|
318
318
|
permissions: options.permissions,
|
@@ -327,10 +327,10 @@ class Client extends node_events_1.default {
|
|
327
327
|
return this.util.roleFromRaw(response);
|
328
328
|
}
|
329
329
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
|
330
|
-
async createGuildScheduledEvent(
|
331
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildScheduledEvents(
|
330
|
+
async createGuildScheduledEvent(guildID, options, reason) {
|
331
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildScheduledEvents(guildID), {
|
332
332
|
json: {
|
333
|
-
channel_id: options.
|
333
|
+
channel_id: options.channelID,
|
334
334
|
entity_metadata: options.entityMetadata,
|
335
335
|
name: options.name,
|
336
336
|
privacy_level: options.privacyLevel,
|
@@ -345,21 +345,21 @@ class Client extends node_events_1.default {
|
|
345
345
|
return this.util.guildScheduledEventFromRaw(response);
|
346
346
|
}
|
347
347
|
/** https://discord.com/developers/docs/resources/sticker#create-guild-sticker */
|
348
|
-
async createGuildSticker(
|
348
|
+
async createGuildSticker(guildID, options, reason) {
|
349
349
|
const formData = new FormData();
|
350
350
|
formData.set("name", options.name);
|
351
351
|
formData.set("description", options.description);
|
352
352
|
formData.set("tags", options.tags);
|
353
353
|
formData.set("file", new Blob([options.file.contents]), options.file.name);
|
354
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildStickers(
|
354
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildStickers(guildID), {
|
355
355
|
form: formData,
|
356
356
|
reason,
|
357
357
|
});
|
358
358
|
return this.util.stickerFromRaw(response);
|
359
359
|
}
|
360
360
|
/** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
|
361
|
-
async createGuildTemplate(
|
362
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildTemplates(
|
361
|
+
async createGuildTemplate(guildID, options) {
|
362
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildTemplates(guildID), {
|
363
363
|
json: {
|
364
364
|
name: options.name,
|
365
365
|
description: options.description,
|
@@ -368,8 +368,8 @@ class Client extends node_events_1.default {
|
|
368
368
|
return this.util.guildTemplateFromRaw(response);
|
369
369
|
}
|
370
370
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */
|
371
|
-
async createInteractionFollowupMessage(
|
372
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(
|
371
|
+
async createInteractionFollowupMessage(applicationID, interactionToken, options) {
|
372
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(applicationID, interactionToken), {
|
373
373
|
json: {
|
374
374
|
content: options.content,
|
375
375
|
tts: options.tts,
|
@@ -398,7 +398,7 @@ class Client extends node_events_1.default {
|
|
398
398
|
? {
|
399
399
|
question: options.poll.question,
|
400
400
|
answers: options.poll.answers.map((answer) => ({
|
401
|
-
answer_id: answer.
|
401
|
+
answer_id: answer.answerID,
|
402
402
|
poll_media: answer.pollMedia,
|
403
403
|
})),
|
404
404
|
duration: options.poll.duration,
|
@@ -412,12 +412,12 @@ class Client extends node_events_1.default {
|
|
412
412
|
return this.util.messageFromRaw(response);
|
413
413
|
}
|
414
414
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */
|
415
|
-
createInteractionResponse(
|
415
|
+
createInteractionResponse(interactionID, interactionToken, options) {
|
416
416
|
switch (options.type) {
|
417
417
|
case constants_1.InteractionCallbackType.ChannelMessageWithSource:
|
418
418
|
case constants_1.InteractionCallbackType.UpdateMessage:
|
419
419
|
{
|
420
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(
|
420
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
|
421
421
|
json: {
|
422
422
|
type: options.type,
|
423
423
|
data: {
|
@@ -442,7 +442,7 @@ class Client extends node_events_1.default {
|
|
442
442
|
? {
|
443
443
|
question: options.data.poll.question,
|
444
444
|
answers: options.data.poll.answers.map((answer) => ({
|
445
|
-
answer_id: answer.
|
445
|
+
answer_id: answer.answerID,
|
446
446
|
poll_media: answer.pollMedia,
|
447
447
|
})),
|
448
448
|
duration: options.data.poll.duration,
|
@@ -459,7 +459,7 @@ class Client extends node_events_1.default {
|
|
459
459
|
case constants_1.InteractionCallbackType.DeferredChannelMessageWithSource:
|
460
460
|
case constants_1.InteractionCallbackType.DeferredUpdateMessage:
|
461
461
|
{
|
462
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(
|
462
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
|
463
463
|
json: {
|
464
464
|
type: options.type,
|
465
465
|
data: {
|
@@ -471,7 +471,7 @@ class Client extends node_events_1.default {
|
|
471
471
|
break;
|
472
472
|
case constants_1.InteractionCallbackType.ApplicationCommandAutocompleteResult:
|
473
473
|
{
|
474
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(
|
474
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
|
475
475
|
json: {
|
476
476
|
type: options.type,
|
477
477
|
data: {
|
@@ -487,11 +487,11 @@ class Client extends node_events_1.default {
|
|
487
487
|
break;
|
488
488
|
case constants_1.InteractionCallbackType.Modal:
|
489
489
|
{
|
490
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(
|
490
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
|
491
491
|
json: {
|
492
492
|
type: options.type,
|
493
493
|
data: {
|
494
|
-
custom_id: options.data?.
|
494
|
+
custom_id: options.data?.customID,
|
495
495
|
components: options.data?.components !== undefined
|
496
496
|
? this.util.messageComponentsToRaw(options.data.components)
|
497
497
|
: undefined,
|
@@ -503,7 +503,7 @@ class Client extends node_events_1.default {
|
|
503
503
|
break;
|
504
504
|
case constants_1.InteractionCallbackType.PremiumRequired:
|
505
505
|
{
|
506
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(
|
506
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionID, interactionToken), {
|
507
507
|
json: {
|
508
508
|
type: options.type,
|
509
509
|
data: {},
|
@@ -514,8 +514,8 @@ class Client extends node_events_1.default {
|
|
514
514
|
}
|
515
515
|
}
|
516
516
|
/** https://discord.com/developers/docs/resources/channel#create-message */
|
517
|
-
async createMessage(
|
518
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(
|
517
|
+
async createMessage(channelID, options) {
|
518
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelID), {
|
519
519
|
json: {
|
520
520
|
content: options.content,
|
521
521
|
nonce: options.nonce,
|
@@ -533,7 +533,7 @@ class Client extends node_events_1.default {
|
|
533
533
|
components: options.components !== undefined
|
534
534
|
? this.util.messageComponentsToRaw(options.components)
|
535
535
|
: undefined,
|
536
|
-
stickers_ids: options.
|
536
|
+
stickers_ids: options.stickersIDs,
|
537
537
|
attachments: options.attachments?.map((attachment) => this.util.attachmentToRaw(attachment)),
|
538
538
|
flags: options.flags,
|
539
539
|
enforce_nonce: options.enforceNonce,
|
@@ -541,7 +541,7 @@ class Client extends node_events_1.default {
|
|
541
541
|
? {
|
542
542
|
question: options.poll.question,
|
543
543
|
answers: options.poll.answers.map((answer) => ({
|
544
|
-
answer_id: answer.
|
544
|
+
answer_id: answer.answerID,
|
545
545
|
poll_media: answer.pollMedia,
|
546
546
|
})),
|
547
547
|
duration: options.poll.duration,
|
@@ -555,37 +555,37 @@ class Client extends node_events_1.default {
|
|
555
555
|
return this.util.messageFromRaw(response);
|
556
556
|
}
|
557
557
|
/** https://discord.com/developers/docs/resources/channel#create-reaction */
|
558
|
-
createMessageReaction(
|
559
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelMessageReaction(
|
558
|
+
createMessageReaction(channelID, messageID, emoji) {
|
559
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelMessageReaction(channelID, messageID, emoji));
|
560
560
|
}
|
561
561
|
/** https://discord.com/developers/docs/resources/stage-instance#create-stage-instance */
|
562
562
|
async createStageInstance(options, reason) {
|
563
563
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.stageInstances(), {
|
564
564
|
json: {
|
565
|
-
channel_id: options.
|
565
|
+
channel_id: options.channelID,
|
566
566
|
topic: options.topic,
|
567
567
|
privacy_level: options.privacyLevel,
|
568
568
|
send_start_notifications: options.sendStartNotifications,
|
569
|
-
guild_scheduled_event_id: options.
|
569
|
+
guild_scheduled_event_id: options.guildScheduledEventID,
|
570
570
|
},
|
571
571
|
reason,
|
572
572
|
});
|
573
573
|
return this.util.stageInstanceFromRaw(response);
|
574
574
|
}
|
575
575
|
/** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
|
576
|
-
async createTestEntitlement(
|
577
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlements(
|
576
|
+
async createTestEntitlement(applicationID, options) {
|
577
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
578
578
|
json: {
|
579
|
-
sku_id: options.
|
580
|
-
owner_id: options.
|
579
|
+
sku_id: options.skuID,
|
580
|
+
owner_id: options.ownerID,
|
581
581
|
owner_type: options.ownerType,
|
582
582
|
},
|
583
583
|
});
|
584
584
|
return this.util.testEntitlementFromRaw(response);
|
585
585
|
}
|
586
586
|
/** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel */
|
587
|
-
async createThread(
|
588
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(
|
587
|
+
async createThread(channelID, options, reason) {
|
588
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelID), {
|
589
589
|
json: {
|
590
590
|
name: options.name,
|
591
591
|
auto_archive_duration: options.autoArchiveDuration,
|
@@ -612,8 +612,8 @@ class Client extends node_events_1.default {
|
|
612
612
|
return this.util.channelFromRaw(response);
|
613
613
|
}
|
614
614
|
/** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
|
615
|
-
async createThreadFromMessage(
|
616
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(
|
615
|
+
async createThreadFromMessage(channelID, messageID, options, reason) {
|
616
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelID, messageID), {
|
617
617
|
json: {
|
618
618
|
name: options.name,
|
619
619
|
auto_archive_duration: options.autoArchiveDuration,
|
@@ -624,8 +624,8 @@ class Client extends node_events_1.default {
|
|
624
624
|
return this.util.channelFromRaw(response);
|
625
625
|
}
|
626
626
|
/** https://discord.com/developers/docs/resources/channel#start-thread-without-message */
|
627
|
-
async createThreadWithoutMessage(
|
628
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(
|
627
|
+
async createThreadWithoutMessage(channelID, options, reason) {
|
628
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelID), {
|
629
629
|
json: {
|
630
630
|
name: options.name,
|
631
631
|
auto_archive_duration: options.autoArchiveDuration,
|
@@ -638,76 +638,76 @@ class Client extends node_events_1.default {
|
|
638
638
|
return this.util.channelFromRaw(response);
|
639
639
|
}
|
640
640
|
/** https://discord.com/developers/docs/resources/channel#crosspost-message */
|
641
|
-
async crosspostMessage(
|
642
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessage(
|
641
|
+
async crosspostMessage(channelID, messageID) {
|
642
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessage(channelID, messageID));
|
643
643
|
return this.util.messageFromRaw(response);
|
644
644
|
}
|
645
645
|
/** https://discord.com/developers/docs/resources/channel#delete-all-reactions */
|
646
|
-
deleteAllMessageReactions(
|
647
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageAllReactions(
|
646
|
+
deleteAllMessageReactions(channelID, messageID, emoji) {
|
647
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageAllReactions(channelID, messageID, emoji));
|
648
648
|
}
|
649
649
|
/** https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
|
650
|
-
deleteAutoModerationRule(
|
651
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildAutoModerationRule(
|
650
|
+
deleteAutoModerationRule(guildID, autoModerationRuleID, reason) {
|
651
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildAutoModerationRule(guildID, autoModerationRuleID), {
|
652
652
|
reason,
|
653
653
|
});
|
654
654
|
}
|
655
655
|
/** https://discord.com/developers/docs/resources/channel#deleteclose-channel */
|
656
|
-
async deleteChannel(
|
657
|
-
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channel(
|
656
|
+
async deleteChannel(channelID, reason) {
|
657
|
+
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channel(channelID), {
|
658
658
|
reason,
|
659
659
|
});
|
660
660
|
return this.util.channelFromRaw(response);
|
661
661
|
}
|
662
662
|
/** https://discord.com/developers/docs/resources/channel#delete-channel-permission */
|
663
|
-
deleteChannelPermission(
|
664
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPermission(
|
663
|
+
deleteChannelPermission(channelID, overwriteID, reason) {
|
664
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPermission(channelID, overwriteID), {
|
665
665
|
reason,
|
666
666
|
});
|
667
667
|
}
|
668
668
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
|
669
|
-
deleteGlobalApplicationCommand(
|
670
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationCommand(
|
669
|
+
deleteGlobalApplicationCommand(applicationID, commandID) {
|
670
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationCommand(applicationID, commandID));
|
671
671
|
}
|
672
672
|
/** https://discord.com/developers/docs/resources/guild#delete-guild */
|
673
|
-
deleteGuild(
|
674
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guild(
|
673
|
+
deleteGuild(guildID) {
|
674
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guild(guildID));
|
675
675
|
}
|
676
676
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
677
|
-
deleteGuildApplicationCommand(
|
678
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationGuildCommand(
|
677
|
+
deleteGuildApplicationCommand(applicationID, guildID, commandID) {
|
678
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationGuildCommand(applicationID, guildID, commandID));
|
679
679
|
}
|
680
680
|
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
681
|
-
deleteGuildEmoji(
|
682
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildEmoji(
|
681
|
+
deleteGuildEmoji(guildID, emojiID, reason) {
|
682
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildEmoji(guildID, emojiID), {
|
683
683
|
reason,
|
684
684
|
});
|
685
685
|
}
|
686
686
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-integration */
|
687
|
-
deleteGuildIntegration(
|
688
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildIntegration(
|
687
|
+
deleteGuildIntegration(guildID, integrationID, reason) {
|
688
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildIntegration(guildID, integrationID), {
|
689
689
|
reason,
|
690
690
|
});
|
691
691
|
}
|
692
692
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-role */
|
693
|
-
deleteGuildRole(
|
694
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildRole(
|
693
|
+
deleteGuildRole(guildID, roleID, reason) {
|
694
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildRole(guildID, roleID), {
|
695
695
|
reason,
|
696
696
|
});
|
697
697
|
}
|
698
698
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event */
|
699
|
-
deleteGuildScheduledEvent(
|
700
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildScheduledEvent(
|
699
|
+
deleteGuildScheduledEvent(guildID, guildScheduledEventID) {
|
700
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildScheduledEvent(guildID, guildScheduledEventID));
|
701
701
|
}
|
702
702
|
/** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
|
703
|
-
deleteGuildSticker(
|
704
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildSticker(
|
703
|
+
deleteGuildSticker(guildID, stickerID, reason) {
|
704
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildSticker(guildID, stickerID), {
|
705
705
|
reason,
|
706
706
|
});
|
707
707
|
}
|
708
708
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
709
|
-
async deleteGuildTemplate(
|
710
|
-
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildTemplate(
|
709
|
+
async deleteGuildTemplate(guildID, code) {
|
710
|
+
const response = await this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildTemplate(guildID, code));
|
711
711
|
return this.util.guildTemplateFromRaw(response);
|
712
712
|
}
|
713
713
|
/** https://discord.com/developers/docs/resources/invite#delete-invite */
|
@@ -718,50 +718,50 @@ class Client extends node_events_1.default {
|
|
718
718
|
return this.util.inviteFromRaw(response);
|
719
719
|
}
|
720
720
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message */
|
721
|
-
deleteInteractionFollowupMessage(
|
722
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(
|
721
|
+
deleteInteractionFollowupMessage(applicationID, interactionToken, messageID) {
|
722
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationID, interactionToken, messageID));
|
723
723
|
}
|
724
724
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response */
|
725
|
-
deleteInteractionResponse(
|
726
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(
|
725
|
+
deleteInteractionResponse(applicationID, interactionToken) {
|
726
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationID, interactionToken));
|
727
727
|
}
|
728
728
|
/** https://discord.com/developers/docs/resources/channel#delete-message */
|
729
|
-
deleteMessage(
|
730
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessage(
|
729
|
+
deleteMessage(channelID, messageID, reason) {
|
730
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessage(channelID, messageID), {
|
731
731
|
reason,
|
732
732
|
});
|
733
733
|
}
|
734
734
|
/** https://discord.com/developers/docs/resources/channel#delete-user-reaction */
|
735
|
-
deleteMessageReaction(
|
736
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageReaction(
|
735
|
+
deleteMessageReaction(channelID, messageID, emoji, userID) {
|
736
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageReaction(channelID, messageID, emoji, userID));
|
737
737
|
}
|
738
738
|
/** https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance */
|
739
|
-
deleteStageInstance(
|
740
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.stageInstance(
|
739
|
+
deleteStageInstance(channelID, reason) {
|
740
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.stageInstance(channelID), {
|
741
741
|
reason,
|
742
742
|
});
|
743
743
|
}
|
744
744
|
/** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
|
745
|
-
deleteTestEntitlement(
|
746
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationEntitlement(
|
745
|
+
deleteTestEntitlement(applicationID, entitlementID) {
|
746
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationEntitlement(applicationID, entitlementID));
|
747
747
|
}
|
748
748
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook */
|
749
|
-
deleteWebhook(
|
750
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(
|
749
|
+
deleteWebhook(webhookID, reason) {
|
750
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(webhookID), {
|
751
751
|
reason,
|
752
752
|
});
|
753
753
|
}
|
754
754
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook-message */
|
755
|
-
deleteWebhookMessage(
|
756
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(
|
755
|
+
deleteWebhookMessage(webhookID, webhookToken, messageID, options) {
|
756
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(webhookID, webhookToken, messageID), {
|
757
757
|
query: {
|
758
|
-
thread_id: options?.
|
758
|
+
thread_id: options?.threadID,
|
759
759
|
},
|
760
760
|
});
|
761
761
|
}
|
762
762
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */
|
763
|
-
deleteWebhookWithToken(
|
764
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(
|
763
|
+
deleteWebhookWithToken(webhookID, webhookToken, reason) {
|
764
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(webhookID, webhookToken), {
|
765
765
|
reason,
|
766
766
|
authorization: false,
|
767
767
|
});
|
@@ -770,8 +770,8 @@ class Client extends node_events_1.default {
|
|
770
770
|
this.shards.disconnect();
|
771
771
|
}
|
772
772
|
/** https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule */
|
773
|
-
async editAutoModerationRule(
|
774
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildAutoModerationRule(
|
773
|
+
async editAutoModerationRule(guildID, autoModerationRuleID, options, reason) {
|
774
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildAutoModerationRule(guildID, autoModerationRuleID), {
|
775
775
|
json: {
|
776
776
|
name: options.name,
|
777
777
|
event_type: options.eventType,
|
@@ -780,7 +780,7 @@ class Client extends node_events_1.default {
|
|
780
780
|
actions: options.actions?.map((action) => ({
|
781
781
|
type: action.type,
|
782
782
|
metadata: {
|
783
|
-
channel_id: action.metadata.
|
783
|
+
channel_id: action.metadata.channelID,
|
784
784
|
duration_seconds: action.metadata.durationSeconds,
|
785
785
|
custom_message: action.metadata.customMessage,
|
786
786
|
},
|
@@ -794,8 +794,8 @@ class Client extends node_events_1.default {
|
|
794
794
|
return this.util.autoModerationRuleFromRaw(response);
|
795
795
|
}
|
796
796
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
797
|
-
async editApplicationCommandPermissions(
|
798
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommandPermissions(
|
797
|
+
async editApplicationCommandPermissions(applicationID, guildID, commandID, options) {
|
798
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommandPermissions(applicationID, guildID, commandID), {
|
799
799
|
json: {
|
800
800
|
permissions: options.permissions.map((permission) => this.util.guildApplicationCommandPermissionsToRaw(permission)),
|
801
801
|
},
|
@@ -803,8 +803,8 @@ class Client extends node_events_1.default {
|
|
803
803
|
return this.util.guildApplicationCommandPermissionsFromRaw(response);
|
804
804
|
}
|
805
805
|
/** https://discord.com/developers/docs/resources/channel#modify-channel */
|
806
|
-
async editChannel(
|
807
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channel(
|
806
|
+
async editChannel(channelID, options, reason) {
|
807
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channel(channelID), {
|
808
808
|
json: {
|
809
809
|
name: options.name,
|
810
810
|
type: options.type,
|
@@ -814,7 +814,7 @@ class Client extends node_events_1.default {
|
|
814
814
|
rate_limit_per_user: options.rateLimitPerUser,
|
815
815
|
bitrate: options.bitrate,
|
816
816
|
permission_overwrites: options.permissionOverwrites,
|
817
|
-
parent_id: options.
|
817
|
+
parent_id: options.parentID,
|
818
818
|
rtc_region: options.rtcRegion,
|
819
819
|
video_quality_mode: options.videoQualityMode,
|
820
820
|
default_auto_archive_duration: options.defaultAutoArchiveDuration,
|
@@ -835,20 +835,20 @@ class Client extends node_events_1.default {
|
|
835
835
|
return this.util.channelFromRaw(response);
|
836
836
|
}
|
837
837
|
/** https://discord.com/developers/docs/resources/channel#edit-channel-permissions */
|
838
|
-
editChannelPermissions(
|
839
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPermission(
|
838
|
+
editChannelPermissions(channelID, overwriteID, options, reason) {
|
839
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPermission(channelID, overwriteID), {
|
840
840
|
json: options,
|
841
841
|
reason,
|
842
842
|
});
|
843
843
|
}
|
844
844
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
|
845
|
-
editChannelPositions(
|
846
|
-
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildChannels(
|
845
|
+
editChannelPositions(guildID, options) {
|
846
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildChannels(guildID), {
|
847
847
|
json: options.map((data) => ({
|
848
848
|
id: data.id,
|
849
849
|
position: data.position,
|
850
850
|
lock_permissions: data.lockPermissions,
|
851
|
-
parent_id: data.
|
851
|
+
parent_id: data.parentID,
|
852
852
|
})),
|
853
853
|
});
|
854
854
|
}
|
@@ -864,8 +864,8 @@ class Client extends node_events_1.default {
|
|
864
864
|
return this.util.userFromRaw(response);
|
865
865
|
}
|
866
866
|
/** https://discord.com/developers/docs/resources/guild#modify-current-member */
|
867
|
-
async editCurrentGuildMember(
|
868
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(
|
867
|
+
async editCurrentGuildMember(guildID, options, reason) {
|
868
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(guildID), {
|
869
869
|
json: {
|
870
870
|
nick: options.nick,
|
871
871
|
},
|
@@ -874,10 +874,10 @@ class Client extends node_events_1.default {
|
|
874
874
|
return this.util.guildMemberFromRaw(response);
|
875
875
|
}
|
876
876
|
/** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
|
877
|
-
editCurrentUserVoiceState(
|
878
|
-
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(
|
877
|
+
editCurrentUserVoiceState(guildID, options) {
|
878
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(guildID), {
|
879
879
|
json: {
|
880
|
-
channel_id: options.
|
880
|
+
channel_id: options.channelID,
|
881
881
|
suppress: options.suppress,
|
882
882
|
requestToSpeakTimestamp: options.requestToSpeakTimestamp,
|
883
883
|
},
|
@@ -901,52 +901,52 @@ class Client extends node_events_1.default {
|
|
901
901
|
return this.util.applicationFromRaw(response);
|
902
902
|
}
|
903
903
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
|
904
|
-
async editGlobalApplicationCommand(
|
905
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationCommand(
|
904
|
+
async editGlobalApplicationCommand(applicationID, commandID, options) {
|
905
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationCommand(applicationID, commandID), {
|
906
906
|
json: this.util.partialApplicationCommandToRaw(options),
|
907
907
|
});
|
908
908
|
return this.util.applicationCommandFromRaw(response);
|
909
909
|
}
|
910
910
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
911
|
-
async editGuild(
|
912
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guild(
|
911
|
+
async editGuild(guildID, options, reason) {
|
912
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guild(guildID), {
|
913
913
|
json: {
|
914
914
|
name: options.name,
|
915
915
|
region: options.region,
|
916
916
|
verification_level: options.verificationLevel,
|
917
917
|
default_message_notifications: options.defaultMessageNotifications,
|
918
918
|
explicit_content_filter: options.explicitContentFilter,
|
919
|
-
afk_channel_id: options.
|
919
|
+
afk_channel_id: options.afkChannelID,
|
920
920
|
afk_timeout: options.afkTimeout,
|
921
921
|
icon: options.icon,
|
922
|
-
owner_id: options.
|
922
|
+
owner_id: options.ownerID,
|
923
923
|
splash: options.splash,
|
924
924
|
discovery_splash: options.discoverySplash,
|
925
925
|
banner: options.banner,
|
926
|
-
system_channel_id: options.
|
926
|
+
system_channel_id: options.systemChannelID,
|
927
927
|
system_channel_flags: options.systemChannelFlags,
|
928
|
-
rules_channel_id: options.
|
929
|
-
public_updates_channel_id: options.
|
928
|
+
rules_channel_id: options.rulesChannelID,
|
929
|
+
public_updates_channel_id: options.publicUpdatesChannelID,
|
930
930
|
preferred_locale: options.preferredLocale,
|
931
931
|
features: options.features,
|
932
932
|
description: options.description,
|
933
933
|
premium_progress_bar_enabled: options.premiumProgressBarEnabled,
|
934
|
-
safety_alerts_channel_id: options.
|
934
|
+
safety_alerts_channel_id: options.safetyAlertsChannelID,
|
935
935
|
},
|
936
936
|
reason,
|
937
937
|
});
|
938
938
|
return this.util.guildFromRaw(response);
|
939
939
|
}
|
940
940
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
|
941
|
-
async editGuildApplicationCommand(
|
942
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationGuildCommand(
|
941
|
+
async editGuildApplicationCommand(applicationID, guildID, commandID, options) {
|
942
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationGuildCommand(applicationID, guildID, commandID), {
|
943
943
|
json: this.util.partialApplicationCommandToRaw(options),
|
944
944
|
});
|
945
945
|
return this.util.applicationCommandFromRaw(response);
|
946
946
|
}
|
947
947
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
|
948
|
-
async editGuildEmoji(
|
949
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildEmoji(
|
948
|
+
async editGuildEmoji(guildID, emojiID, options, reason) {
|
949
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildEmoji(guildID, emojiID), {
|
950
950
|
json: {
|
951
951
|
name: options.name,
|
952
952
|
roles: options.roles,
|
@@ -956,14 +956,14 @@ class Client extends node_events_1.default {
|
|
956
956
|
return this.util.emojiFromRaw(response);
|
957
957
|
}
|
958
958
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
|
959
|
-
async editGuildMember(
|
960
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(
|
959
|
+
async editGuildMember(guildID, userID, options, reason) {
|
960
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(guildID, userID), {
|
961
961
|
json: {
|
962
962
|
nick: options.nick,
|
963
963
|
roles: options.roles,
|
964
964
|
mute: options.mute,
|
965
965
|
deaf: options.deaf,
|
966
|
-
channel_id: options.
|
966
|
+
channel_id: options.channelID,
|
967
967
|
communication_disabled_until: options.communicationDisabledUntil,
|
968
968
|
flags: options.flags,
|
969
969
|
},
|
@@ -972,8 +972,8 @@ class Client extends node_events_1.default {
|
|
972
972
|
return this.util.guildMemberFromRaw(response);
|
973
973
|
}
|
974
974
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level */
|
975
|
-
editGuildMFALevel(
|
976
|
-
return this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildMFA(
|
975
|
+
editGuildMFALevel(guildID, options, reason) {
|
976
|
+
return this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildMFA(guildID), {
|
977
977
|
json: {
|
978
978
|
level: options.level,
|
979
979
|
},
|
@@ -981,20 +981,20 @@ class Client extends node_events_1.default {
|
|
981
981
|
});
|
982
982
|
}
|
983
983
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
|
984
|
-
editGuildOnboarding(
|
985
|
-
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildOnboarding(
|
984
|
+
editGuildOnboarding(guildID, options, reason) {
|
985
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildOnboarding(guildID), {
|
986
986
|
json: {
|
987
987
|
prompts: options.prompts.map((prompt) => ({
|
988
988
|
id: prompt.id,
|
989
989
|
type: prompt.type,
|
990
990
|
options: prompt.options.map((promptOption) => ({
|
991
991
|
id: promptOption.id,
|
992
|
-
channel_ids: promptOption.
|
993
|
-
role_ids: promptOption.
|
992
|
+
channel_ids: promptOption.channelIDs,
|
993
|
+
role_ids: promptOption.roleIDs,
|
994
994
|
emoji: promptOption.emoji !== undefined
|
995
995
|
? this.util.emojiToRaw(promptOption.emoji)
|
996
996
|
: undefined,
|
997
|
-
emoji_id: promptOption.
|
997
|
+
emoji_id: promptOption.emojiID,
|
998
998
|
emoji_name: promptOption.emojiName,
|
999
999
|
emoji_animated: promptOption.emojiAnimated,
|
1000
1000
|
title: promptOption.title,
|
@@ -1010,8 +1010,8 @@ class Client extends node_events_1.default {
|
|
1010
1010
|
});
|
1011
1011
|
}
|
1012
1012
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role */
|
1013
|
-
async editGuildRole(
|
1014
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRole(
|
1013
|
+
async editGuildRole(guildID, roleID, options, reason) {
|
1014
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRole(guildID, roleID), {
|
1015
1015
|
json: {
|
1016
1016
|
name: options?.name,
|
1017
1017
|
permissions: options?.permissions,
|
@@ -1026,17 +1026,17 @@ class Client extends node_events_1.default {
|
|
1026
1026
|
return this.util.roleFromRaw(response);
|
1027
1027
|
}
|
1028
1028
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
|
1029
|
-
async editGuildRolePositions(
|
1030
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRoles(
|
1029
|
+
async editGuildRolePositions(guildID, options) {
|
1030
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRoles(guildID), {
|
1031
1031
|
json: options,
|
1032
1032
|
});
|
1033
1033
|
return response.map((role) => this.util.roleFromRaw(role));
|
1034
1034
|
}
|
1035
1035
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
|
1036
|
-
async editGuildScheduledEvent(
|
1037
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildScheduledEvent(
|
1036
|
+
async editGuildScheduledEvent(guildID, guildScheduledEventID, options, reason) {
|
1037
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildScheduledEvent(guildID, guildScheduledEventID), {
|
1038
1038
|
json: {
|
1039
|
-
channel_id: options.
|
1039
|
+
channel_id: options.channelID,
|
1040
1040
|
entity_metadata: options.entityMetadata,
|
1041
1041
|
name: options.name,
|
1042
1042
|
privacy_level: options.privacyLevel,
|
@@ -1052,8 +1052,8 @@ class Client extends node_events_1.default {
|
|
1052
1052
|
return this.util.guildScheduledEventFromRaw(response);
|
1053
1053
|
}
|
1054
1054
|
/** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
|
1055
|
-
async editGuildSticker(
|
1056
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildSticker(
|
1055
|
+
async editGuildSticker(guildID, stickerID, options, reason) {
|
1056
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildSticker(guildID, stickerID), {
|
1057
1057
|
json: {
|
1058
1058
|
name: options.name,
|
1059
1059
|
description: options.description,
|
@@ -1064,8 +1064,8 @@ class Client extends node_events_1.default {
|
|
1064
1064
|
return this.util.stickerFromRaw(response);
|
1065
1065
|
}
|
1066
1066
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
1067
|
-
async editGuildTemplate(
|
1068
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildTemplate(
|
1067
|
+
async editGuildTemplate(guildID, code, options) {
|
1068
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildTemplate(guildID, code), {
|
1069
1069
|
json: {
|
1070
1070
|
name: options.name,
|
1071
1071
|
description: options.description,
|
@@ -1074,8 +1074,8 @@ class Client extends node_events_1.default {
|
|
1074
1074
|
return this.util.guildTemplateFromRaw(response);
|
1075
1075
|
}
|
1076
1076
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
|
1077
|
-
async editGuildWelcomeScreen(
|
1078
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWelcomeScreen(
|
1077
|
+
async editGuildWelcomeScreen(guildID, options, reason) {
|
1078
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWelcomeScreen(guildID), {
|
1079
1079
|
json: {
|
1080
1080
|
enabled: options.enabled,
|
1081
1081
|
welcome_channels: options.welcomeChannels,
|
@@ -1086,30 +1086,30 @@ class Client extends node_events_1.default {
|
|
1086
1086
|
return {
|
1087
1087
|
description: response.description,
|
1088
1088
|
welcomeChannels: response.welcome_channels.map((welcomeScreenChannel) => ({
|
1089
|
-
|
1089
|
+
channelID: welcomeScreenChannel.channel_id,
|
1090
1090
|
description: welcomeScreenChannel.description,
|
1091
|
-
|
1091
|
+
emojiID: welcomeScreenChannel.emoji_id,
|
1092
1092
|
emojiName: welcomeScreenChannel.emoji_name,
|
1093
1093
|
})),
|
1094
1094
|
};
|
1095
1095
|
}
|
1096
1096
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-widget */
|
1097
|
-
async editGuildWidget(
|
1098
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWidgetSettings(
|
1097
|
+
async editGuildWidget(guildID, options, reason) {
|
1098
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWidgetSettings(guildID), {
|
1099
1099
|
json: {
|
1100
1100
|
enabled: options.enabled,
|
1101
|
-
channel_id: options.
|
1101
|
+
channel_id: options.channelID,
|
1102
1102
|
},
|
1103
1103
|
reason,
|
1104
1104
|
});
|
1105
1105
|
return {
|
1106
1106
|
enabled: response.enabled,
|
1107
|
-
|
1107
|
+
channelID: response.channel_id,
|
1108
1108
|
};
|
1109
1109
|
}
|
1110
1110
|
/** https://discord.com/developers/docs/resources/channel#edit-message */
|
1111
|
-
async editMessage(
|
1112
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channelMessage(
|
1111
|
+
async editMessage(channelID, messageID, options) {
|
1112
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channelMessage(channelID, messageID), {
|
1113
1113
|
json: {
|
1114
1114
|
content: options.content,
|
1115
1115
|
embeds: options.embeds !== null
|
@@ -1138,8 +1138,8 @@ class Client extends node_events_1.default {
|
|
1138
1138
|
return this.util.messageFromRaw(response);
|
1139
1139
|
}
|
1140
1140
|
/** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance */
|
1141
|
-
async editStageInstance(
|
1142
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.stageInstance(
|
1141
|
+
async editStageInstance(channelID, options, reason) {
|
1142
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.stageInstance(channelID), {
|
1143
1143
|
json: {
|
1144
1144
|
topic: options.topic,
|
1145
1145
|
privacy_level: options.privacyLevel,
|
@@ -1149,8 +1149,8 @@ class Client extends node_events_1.default {
|
|
1149
1149
|
return this.util.stageInstanceFromRaw(response);
|
1150
1150
|
}
|
1151
1151
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message */
|
1152
|
-
async editInteractionFollowupMessage(
|
1153
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookMessage(
|
1152
|
+
async editInteractionFollowupMessage(applicationID, interactionToken, messageID, options) {
|
1153
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookMessage(applicationID, interactionToken, messageID), {
|
1154
1154
|
json: {
|
1155
1155
|
content: options.content,
|
1156
1156
|
embeds: options.embeds !== null
|
@@ -1176,14 +1176,14 @@ class Client extends node_events_1.default {
|
|
1176
1176
|
},
|
1177
1177
|
files: options.files,
|
1178
1178
|
query: {
|
1179
|
-
thread_id: options.
|
1179
|
+
thread_id: options.threadID,
|
1180
1180
|
},
|
1181
1181
|
});
|
1182
1182
|
return this.util.messageFromRaw(response);
|
1183
1183
|
}
|
1184
1184
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response */
|
1185
|
-
async editInteractionResponse(
|
1186
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(
|
1185
|
+
async editInteractionResponse(applicationID, interactionToken, options) {
|
1186
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(applicationID, interactionToken), {
|
1187
1187
|
json: {
|
1188
1188
|
content: options.content,
|
1189
1189
|
embeds: options.embeds !== null
|
@@ -1209,36 +1209,36 @@ class Client extends node_events_1.default {
|
|
1209
1209
|
},
|
1210
1210
|
files: options.files,
|
1211
1211
|
query: {
|
1212
|
-
thread_id: options.
|
1212
|
+
thread_id: options.threadID,
|
1213
1213
|
},
|
1214
1214
|
});
|
1215
1215
|
return this.util.messageFromRaw(response);
|
1216
1216
|
}
|
1217
1217
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
1218
|
-
editUserVoiceState(
|
1219
|
-
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(
|
1218
|
+
editUserVoiceState(guildID, userID, options) {
|
1219
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(guildID, userID), {
|
1220
1220
|
json: {
|
1221
|
-
channel_id: options.
|
1221
|
+
channel_id: options.channelID,
|
1222
1222
|
suppress: options.suppress,
|
1223
1223
|
requestToSpeakTimestamp: options.requestToSpeakTimestamp,
|
1224
1224
|
},
|
1225
1225
|
});
|
1226
1226
|
}
|
1227
1227
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook */
|
1228
|
-
async editWebhook(
|
1229
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(
|
1228
|
+
async editWebhook(webhookID, options, reason) {
|
1229
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(webhookID), {
|
1230
1230
|
json: {
|
1231
1231
|
name: options.name,
|
1232
1232
|
avatar: options.avatar,
|
1233
|
-
channel_id: options.
|
1233
|
+
channel_id: options.channelID,
|
1234
1234
|
},
|
1235
1235
|
reason,
|
1236
1236
|
});
|
1237
1237
|
return this.util.webhookFromRaw(response);
|
1238
1238
|
}
|
1239
1239
|
/** https://discord.com/developers/docs/resources/webhook#edit-webhook-message */
|
1240
|
-
async editWebhookMessage(
|
1241
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(
|
1240
|
+
async editWebhookMessage(webhookID, webhookToken, messageID, options) {
|
1241
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(webhookID, webhookToken, messageID), {
|
1242
1242
|
json: {
|
1243
1243
|
content: options.content,
|
1244
1244
|
embeds: options.embeds !== null
|
@@ -1264,14 +1264,14 @@ class Client extends node_events_1.default {
|
|
1264
1264
|
},
|
1265
1265
|
files: options.files,
|
1266
1266
|
query: {
|
1267
|
-
thread_id: options.
|
1267
|
+
thread_id: options.threadID,
|
1268
1268
|
},
|
1269
1269
|
});
|
1270
1270
|
return this.util.messageFromRaw(response);
|
1271
1271
|
}
|
1272
1272
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
1273
|
-
async editWebhookWithToken(
|
1274
|
-
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(
|
1273
|
+
async editWebhookWithToken(webhookID, webhookToken, options, reason) {
|
1274
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(webhookID, webhookToken), {
|
1275
1275
|
json: {
|
1276
1276
|
name: options.name,
|
1277
1277
|
avatar: options.avatar,
|
@@ -1282,13 +1282,13 @@ class Client extends node_events_1.default {
|
|
1282
1282
|
return this.util.webhookFromRaw(response);
|
1283
1283
|
}
|
1284
1284
|
/** https://discord.com/developers/docs/resources/poll#end-poll */
|
1285
|
-
async endPoll(
|
1286
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(
|
1285
|
+
async endPoll(channelID, messageID) {
|
1286
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelID, messageID));
|
1287
1287
|
return this.util.messageFromRaw(response);
|
1288
1288
|
}
|
1289
1289
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
1290
|
-
async executeWebhook(
|
1291
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(
|
1290
|
+
async executeWebhook(webhookID, webhookToken, options) {
|
1291
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(webhookID, webhookToken), {
|
1292
1292
|
json: {
|
1293
1293
|
content: options.content,
|
1294
1294
|
username: options.username,
|
@@ -1320,7 +1320,7 @@ class Client extends node_events_1.default {
|
|
1320
1320
|
? {
|
1321
1321
|
question: options.poll.question,
|
1322
1322
|
answers: options.poll.answers.map((answer) => ({
|
1323
|
-
answer_id: answer.
|
1323
|
+
answer_id: answer.answerID,
|
1324
1324
|
poll_media: answer.pollMedia,
|
1325
1325
|
})),
|
1326
1326
|
duration: options.poll.duration,
|
@@ -1332,7 +1332,7 @@ class Client extends node_events_1.default {
|
|
1332
1332
|
files: options.files,
|
1333
1333
|
query: {
|
1334
1334
|
wait: options.wait,
|
1335
|
-
thread_id: options.
|
1335
|
+
thread_id: options.threadID,
|
1336
1336
|
},
|
1337
1337
|
});
|
1338
1338
|
return response !== null ? this.util.messageFromRaw(response) : response;
|
@@ -1342,10 +1342,10 @@ class Client extends node_events_1.default {
|
|
1342
1342
|
*
|
1343
1343
|
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
|
1344
1344
|
*/
|
1345
|
-
async executeWebhookPlatform(
|
1346
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookPlatform(
|
1345
|
+
async executeWebhookPlatform(webhookID, webhookToken, platform, options) {
|
1346
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookPlatform(webhookID, webhookToken, platform), {
|
1347
1347
|
query: {
|
1348
|
-
thread_id: options.
|
1348
|
+
thread_id: options.threadID,
|
1349
1349
|
wait: options.wait,
|
1350
1350
|
},
|
1351
1351
|
json: options,
|
@@ -1353,29 +1353,29 @@ class Client extends node_events_1.default {
|
|
1353
1353
|
return response !== null ? this.util.messageFromRaw(response) : null;
|
1354
1354
|
}
|
1355
1355
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
1356
|
-
async followChannel(
|
1357
|
-
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelFollowers(
|
1356
|
+
async followChannel(channelID, options, reason) {
|
1357
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelFollowers(channelID), {
|
1358
1358
|
json: {
|
1359
|
-
webhook_channel_id: options.
|
1359
|
+
webhook_channel_id: options.webhookChannelID,
|
1360
1360
|
},
|
1361
1361
|
reason,
|
1362
1362
|
});
|
1363
1363
|
return {
|
1364
|
-
|
1365
|
-
|
1364
|
+
channelID: response.channel_id,
|
1365
|
+
webhookID: response.webhook_id,
|
1366
1366
|
};
|
1367
1367
|
}
|
1368
1368
|
/** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
|
1369
|
-
async getActiveGuildThreads(
|
1370
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildActiveThreads(
|
1369
|
+
async getActiveGuildThreads(guildID) {
|
1370
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildActiveThreads(guildID));
|
1371
1371
|
return {
|
1372
1372
|
threads: response.threads.map((thread) => this.util.channelFromRaw(thread)),
|
1373
1373
|
members: response.members.map((threadMember) => this.util.threadMemberFromRaw(threadMember)),
|
1374
1374
|
};
|
1375
1375
|
}
|
1376
1376
|
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
|
1377
|
-
async getArchivedThreads(
|
1378
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(
|
1377
|
+
async getArchivedThreads(channelID, archivedStatus, options) {
|
1378
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(channelID, archivedStatus, false), {
|
1379
1379
|
query: {
|
1380
1380
|
before: options?.before,
|
1381
1381
|
limit: options?.limit,
|
@@ -1388,10 +1388,10 @@ class Client extends node_events_1.default {
|
|
1388
1388
|
};
|
1389
1389
|
}
|
1390
1390
|
/** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */
|
1391
|
-
async getAuditLog(
|
1392
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAuditLog(
|
1391
|
+
async getAuditLog(guildID, options) {
|
1392
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAuditLog(guildID), {
|
1393
1393
|
query: {
|
1394
|
-
user_id: options?.
|
1394
|
+
user_id: options?.userID,
|
1395
1395
|
action_type: options?.actionType,
|
1396
1396
|
before: options?.before,
|
1397
1397
|
after: options?.after,
|
@@ -1401,23 +1401,23 @@ class Client extends node_events_1.default {
|
|
1401
1401
|
return this.util.auditLogFromRaw(response);
|
1402
1402
|
}
|
1403
1403
|
/** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
|
1404
|
-
async getAutoModerationRule(
|
1405
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRule(
|
1404
|
+
async getAutoModerationRule(guildID, ruleID) {
|
1405
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRule(guildID, ruleID));
|
1406
1406
|
return this.util.autoModerationRuleFromRaw(response);
|
1407
1407
|
}
|
1408
1408
|
/** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
|
1409
|
-
async getAutoModerationRules(
|
1410
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRules(
|
1409
|
+
async getAutoModerationRules(guildID) {
|
1410
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRules(guildID));
|
1411
1411
|
return response.map((autoModerationRule) => this.util.autoModerationRuleFromRaw(autoModerationRule));
|
1412
1412
|
}
|
1413
1413
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
1414
|
-
async getApplicationCommandPermissions(
|
1415
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommandPermissions(
|
1414
|
+
async getApplicationCommandPermissions(applicationID, guildID, commandID) {
|
1415
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommandPermissions(applicationID, guildID, commandID));
|
1416
1416
|
return this.util.guildApplicationCommandPermissionsFromRaw(response);
|
1417
1417
|
}
|
1418
1418
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
|
1419
|
-
async getApplicationRoleConnectionMetadataRecords(
|
1420
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationRoleConnectionMetadata(
|
1419
|
+
async getApplicationRoleConnectionMetadataRecords(applicationID) {
|
1420
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationID));
|
1421
1421
|
return response.map((applicationRoleConnectionMetadata) => ({
|
1422
1422
|
type: applicationRoleConnectionMetadata.type,
|
1423
1423
|
key: applicationRoleConnectionMetadata.key,
|
@@ -1428,23 +1428,23 @@ class Client extends node_events_1.default {
|
|
1428
1428
|
}));
|
1429
1429
|
}
|
1430
1430
|
/** https://discord.com/developers/docs/resources/channel#get-channel */
|
1431
|
-
async getChannel(
|
1432
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channel(
|
1431
|
+
async getChannel(channelID) {
|
1432
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channel(channelID));
|
1433
1433
|
return this.util.channelFromRaw(response);
|
1434
1434
|
}
|
1435
1435
|
/** https://discord.com/developers/docs/resources/guild#get-guild-channels */
|
1436
|
-
async getChannels(
|
1437
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildChannels(
|
1436
|
+
async getChannels(guildID) {
|
1437
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildChannels(guildID));
|
1438
1438
|
return response.map((channel) => this.util.channelFromRaw(channel));
|
1439
1439
|
}
|
1440
1440
|
/** https://discord.com/developers/docs/resources/channel#get-channel-invites */
|
1441
|
-
async getChannelInvites(
|
1442
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelInvites(
|
1441
|
+
async getChannelInvites(channelID) {
|
1442
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelInvites(channelID));
|
1443
1443
|
return response.map((invite) => this.util.inviteFromRaw(invite));
|
1444
1444
|
}
|
1445
1445
|
/** https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */
|
1446
|
-
async getChannelWebhooks(
|
1447
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelWebhooks(
|
1446
|
+
async getChannelWebhooks(channelID) {
|
1447
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelWebhooks(channelID));
|
1448
1448
|
return response.map((webhook) => this.util.webhookFromRaw(webhook));
|
1449
1449
|
}
|
1450
1450
|
/** https://discord.com/developers/docs/resources/application#get-current-application */
|
@@ -1453,8 +1453,8 @@ class Client extends node_events_1.default {
|
|
1453
1453
|
return this.util.applicationFromRaw(response);
|
1454
1454
|
}
|
1455
1455
|
/** https://discord.com/developers/docs/resources/user#get-current-user-application-role-connection */
|
1456
|
-
async getCurrentApplicationRoleConnection(
|
1457
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userApplicationRoleConnection(
|
1456
|
+
async getCurrentApplicationRoleConnection(applicationID) {
|
1457
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userApplicationRoleConnection(applicationID));
|
1458
1458
|
return {
|
1459
1459
|
platformName: response.platform_name,
|
1460
1460
|
platformUsername: response.platform_username,
|
@@ -1469,8 +1469,8 @@ class Client extends node_events_1.default {
|
|
1469
1469
|
};
|
1470
1470
|
}
|
1471
1471
|
/** https://discord.com/developers/docs/resources/user#get-current-user-guild-member */
|
1472
|
-
async getCurrentGuildMember(
|
1473
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(
|
1472
|
+
async getCurrentGuildMember(guildID) {
|
1473
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(guildID));
|
1474
1474
|
return this.util.guildMemberFromRaw(response);
|
1475
1475
|
}
|
1476
1476
|
/** https://discord.com/developers/docs/resources/user#get-current-user-connections */
|
@@ -1490,15 +1490,15 @@ class Client extends node_events_1.default {
|
|
1490
1490
|
}));
|
1491
1491
|
}
|
1492
1492
|
/** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
|
1493
|
-
async getEntitlements(
|
1494
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(
|
1493
|
+
async getEntitlements(applicationID, options) {
|
1494
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationID), {
|
1495
1495
|
query: {
|
1496
|
-
user_id: options?.
|
1497
|
-
sku_ids: options?.
|
1496
|
+
user_id: options?.userID,
|
1497
|
+
sku_ids: options?.skuIDs,
|
1498
1498
|
before: options?.before,
|
1499
1499
|
after: options?.after,
|
1500
1500
|
limit: options?.limit,
|
1501
|
-
guild_id: options?.
|
1501
|
+
guild_id: options?.guildID,
|
1502
1502
|
exclude_ended: options?.excludeEnded,
|
1503
1503
|
},
|
1504
1504
|
});
|
@@ -1523,13 +1523,13 @@ class Client extends node_events_1.default {
|
|
1523
1523
|
};
|
1524
1524
|
}
|
1525
1525
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
|
1526
|
-
async getGlobalApplicationCommand(
|
1527
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommand(
|
1526
|
+
async getGlobalApplicationCommand(applicationID, commandID) {
|
1527
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommand(applicationID, commandID));
|
1528
1528
|
return this.util.applicationCommandFromRaw(response);
|
1529
1529
|
}
|
1530
1530
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
|
1531
|
-
async getGlobalApplicationCommands(
|
1532
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommands(
|
1531
|
+
async getGlobalApplicationCommands(applicationID, options) {
|
1532
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommands(applicationID), {
|
1533
1533
|
query: {
|
1534
1534
|
with_localizations: options.withLocalizations,
|
1535
1535
|
},
|
@@ -1537,8 +1537,8 @@ class Client extends node_events_1.default {
|
|
1537
1537
|
return response.map((applicationCommand) => this.util.applicationCommandFromRaw(applicationCommand));
|
1538
1538
|
}
|
1539
1539
|
/** https://discord.com/developers/docs/resources/guild#get-guild */
|
1540
|
-
async getGuild(
|
1541
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guild(
|
1540
|
+
async getGuild(guildID, options) {
|
1541
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guild(guildID), {
|
1542
1542
|
query: {
|
1543
1543
|
with_counts: options?.withCounts,
|
1544
1544
|
},
|
@@ -1558,13 +1558,13 @@ class Client extends node_events_1.default {
|
|
1558
1558
|
return response.map((guild) => this.util.guildFromRaw(guild));
|
1559
1559
|
}
|
1560
1560
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
|
1561
|
-
async getGuildApplicationCommand(
|
1562
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommand(
|
1561
|
+
async getGuildApplicationCommand(applicationID, guildID, commandID) {
|
1562
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommand(applicationID, guildID, commandID));
|
1563
1563
|
return this.util.applicationCommandFromRaw(response);
|
1564
1564
|
}
|
1565
1565
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
|
1566
|
-
async getGuildApplicationCommands(
|
1567
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommands(
|
1566
|
+
async getGuildApplicationCommands(applicationID, guildID, options) {
|
1567
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommands(applicationID, guildID), {
|
1568
1568
|
query: {
|
1569
1569
|
with_localizations: options?.withLocalizations,
|
1570
1570
|
},
|
@@ -1572,21 +1572,21 @@ class Client extends node_events_1.default {
|
|
1572
1572
|
return response.map((applicationCommand) => this.util.applicationCommandFromRaw(applicationCommand));
|
1573
1573
|
}
|
1574
1574
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
|
1575
|
-
async getGuildApplicationCommandPermissions(
|
1576
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildApplicationCommandsPermissions(
|
1575
|
+
async getGuildApplicationCommandPermissions(applicationID, guildID) {
|
1576
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildApplicationCommandsPermissions(applicationID, guildID));
|
1577
1577
|
return this.util.guildApplicationCommandPermissionsFromRaw(response);
|
1578
1578
|
}
|
1579
1579
|
/** https://discord.com/developers/docs/resources/guild#get-guild-ban */
|
1580
|
-
async getGuildBan(
|
1581
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBan(
|
1580
|
+
async getGuildBan(guildID, userID) {
|
1581
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBan(guildID, userID));
|
1582
1582
|
return {
|
1583
1583
|
reason: response.reason,
|
1584
1584
|
user: this.util.userFromRaw(response.user),
|
1585
1585
|
};
|
1586
1586
|
}
|
1587
1587
|
/** https://discord.com/developers/docs/resources/guild#get-guild-bans */
|
1588
|
-
async getGuildBans(
|
1589
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBans(
|
1588
|
+
async getGuildBans(guildID, options) {
|
1589
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBans(guildID), {
|
1590
1590
|
query: {
|
1591
1591
|
limit: options?.limit,
|
1592
1592
|
before: options?.before,
|
@@ -1599,51 +1599,51 @@ class Client extends node_events_1.default {
|
|
1599
1599
|
}));
|
1600
1600
|
}
|
1601
1601
|
/** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
|
1602
|
-
async getGuildEmoji(
|
1603
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmoji(
|
1602
|
+
async getGuildEmoji(guildID, emojiID) {
|
1603
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmoji(guildID, emojiID));
|
1604
1604
|
return this.util.emojiFromRaw(response);
|
1605
1605
|
}
|
1606
1606
|
/** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
|
1607
|
-
async getGuildEmojis(
|
1608
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmojis(
|
1607
|
+
async getGuildEmojis(guildID) {
|
1608
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmojis(guildID));
|
1609
1609
|
return response.map((emoji) => this.util.emojiFromRaw(emoji));
|
1610
1610
|
}
|
1611
1611
|
/** https://discord.com/developers/docs/resources/guild#get-guild-integrations */
|
1612
|
-
async getGuildIntegrations(
|
1613
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildIntegrations(
|
1612
|
+
async getGuildIntegrations(guildID) {
|
1613
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildIntegrations(guildID));
|
1614
1614
|
return response.map((integration) => this.util.integrationFromRaw(integration));
|
1615
1615
|
}
|
1616
1616
|
/** https://discord.com/developers/docs/resources/guild#get-guild-invites */
|
1617
|
-
async getGuildInvites(
|
1618
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildInvites(
|
1617
|
+
async getGuildInvites(guildID) {
|
1618
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildInvites(guildID));
|
1619
1619
|
return response.map((invite) => this.util.inviteFromRaw(invite));
|
1620
1620
|
}
|
1621
1621
|
/** https://discord.com/developers/docs/resources/guild#get-guild-member */
|
1622
|
-
async getGuildMember(
|
1623
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(
|
1622
|
+
async getGuildMember(guildID, userID) {
|
1623
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(guildID, userID));
|
1624
1624
|
return this.util.guildMemberFromRaw(response);
|
1625
1625
|
}
|
1626
1626
|
/** https://discord.com/developers/docs/resources/guild#list-guild-members */
|
1627
|
-
async getGuildMembers(
|
1628
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembers(
|
1627
|
+
async getGuildMembers(guildID) {
|
1628
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembers(guildID));
|
1629
1629
|
return response.map((guildMember) => this.util.guildMemberFromRaw(guildMember));
|
1630
1630
|
}
|
1631
1631
|
/** https://discord.com/developers/docs/resources/guild#get-guild-onboarding */
|
1632
|
-
async getGuildOnboarding(
|
1633
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildOnboarding(
|
1632
|
+
async getGuildOnboarding(guildID) {
|
1633
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildOnboarding(guildID));
|
1634
1634
|
return {
|
1635
|
-
|
1635
|
+
guildID: response.guild_id,
|
1636
1636
|
prompts: response.prompts.map((prompt) => ({
|
1637
1637
|
id: prompt.id,
|
1638
1638
|
type: prompt.type,
|
1639
1639
|
options: prompt.options.map((promptOption) => ({
|
1640
1640
|
id: promptOption.id,
|
1641
|
-
|
1642
|
-
|
1641
|
+
channelIDs: promptOption.channel_ids,
|
1642
|
+
roleIDs: promptOption.role_ids,
|
1643
1643
|
emoji: promptOption.emoji !== undefined
|
1644
1644
|
? this.util.emojiFromRaw(promptOption.emoji)
|
1645
1645
|
: undefined,
|
1646
|
-
|
1646
|
+
emojiID: promptOption.emoji_id,
|
1647
1647
|
emojiName: promptOption.emoji_name,
|
1648
1648
|
emojiAnimated: promptOption.emoji_animated,
|
1649
1649
|
title: promptOption.title,
|
@@ -1654,14 +1654,14 @@ class Client extends node_events_1.default {
|
|
1654
1654
|
required: prompt.required,
|
1655
1655
|
inOnboarding: prompt.in_onboarding,
|
1656
1656
|
})),
|
1657
|
-
|
1657
|
+
defaultChannelIDs: response.default_channel_ids,
|
1658
1658
|
enabled: response.enabled,
|
1659
1659
|
mode: response.mode,
|
1660
1660
|
};
|
1661
1661
|
}
|
1662
1662
|
/** https://discord.com/developers/docs/resources/guild#get-guild-preview */
|
1663
|
-
async getGuildPreview(
|
1664
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPreview(
|
1663
|
+
async getGuildPreview(guildID) {
|
1664
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPreview(guildID));
|
1665
1665
|
return {
|
1666
1666
|
id: response.id,
|
1667
1667
|
name: response.name,
|
@@ -1677,8 +1677,8 @@ class Client extends node_events_1.default {
|
|
1677
1677
|
};
|
1678
1678
|
}
|
1679
1679
|
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
|
1680
|
-
getGuildPruneCount(
|
1681
|
-
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPrune(
|
1680
|
+
getGuildPruneCount(guildID, options) {
|
1681
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPrune(guildID), {
|
1682
1682
|
query: {
|
1683
1683
|
days: options.days,
|
1684
1684
|
include_roles: options.includeRoles,
|
@@ -1686,13 +1686,13 @@ class Client extends node_events_1.default {
|
|
1686
1686
|
});
|
1687
1687
|
}
|
1688
1688
|
/** https://discord.com/developers/docs/resources/guild#get-guild-roles */
|
1689
|
-
async getGuildRoles(
|
1690
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRoles(
|
1689
|
+
async getGuildRoles(guildID) {
|
1690
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRoles(guildID));
|
1691
1691
|
return response.map((role) => this.util.roleFromRaw(role));
|
1692
1692
|
}
|
1693
1693
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild */
|
1694
|
-
async getGuildScheduledEvents(
|
1695
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvents(
|
1694
|
+
async getGuildScheduledEvents(guildID, options) {
|
1695
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvents(guildID), {
|
1696
1696
|
query: {
|
1697
1697
|
with_user_count: options?.withUserCount,
|
1698
1698
|
},
|
@@ -1700,8 +1700,8 @@ class Client extends node_events_1.default {
|
|
1700
1700
|
return response.map((guildScheduledEvent) => this.util.guildScheduledEventFromRaw(guildScheduledEvent));
|
1701
1701
|
}
|
1702
1702
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users */
|
1703
|
-
async getGuildScheduledEventUsers(
|
1704
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvent(
|
1703
|
+
async getGuildScheduledEventUsers(guildID, guildScheduledEventID, options) {
|
1704
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvent(guildID, guildScheduledEventID), {
|
1705
1705
|
query: {
|
1706
1706
|
limit: options?.limit,
|
1707
1707
|
with_member: options?.withMember,
|
@@ -1710,7 +1710,7 @@ class Client extends node_events_1.default {
|
|
1710
1710
|
},
|
1711
1711
|
});
|
1712
1712
|
return response.map((guildScheduledEventUser) => ({
|
1713
|
-
|
1713
|
+
guildScheduledEventID: guildScheduledEventUser.guild_scheduled_event_id,
|
1714
1714
|
user: this.util.userFromRaw(guildScheduledEventUser.user),
|
1715
1715
|
member: guildScheduledEventUser.member !== undefined
|
1716
1716
|
? this.util.guildMemberFromRaw(guildScheduledEventUser.member)
|
@@ -1718,32 +1718,32 @@ class Client extends node_events_1.default {
|
|
1718
1718
|
}));
|
1719
1719
|
}
|
1720
1720
|
/** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
|
1721
|
-
async getGuildSticker(
|
1722
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSticker(
|
1721
|
+
async getGuildSticker(guildID, stickerID) {
|
1722
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSticker(guildID, stickerID));
|
1723
1723
|
return this.util.stickerFromRaw(response);
|
1724
1724
|
}
|
1725
1725
|
/** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
|
1726
|
-
async getGuildStickers(
|
1727
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildStickers(
|
1726
|
+
async getGuildStickers(guildID) {
|
1727
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildStickers(guildID));
|
1728
1728
|
return response.map((sticker) => this.util.stickerFromRaw(sticker));
|
1729
1729
|
}
|
1730
1730
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
1731
|
-
async getGuildTemplate(
|
1732
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplate(
|
1731
|
+
async getGuildTemplate(guildID, code) {
|
1732
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplate(guildID, code));
|
1733
1733
|
return this.util.guildTemplateFromRaw(response);
|
1734
1734
|
}
|
1735
1735
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-templates */
|
1736
|
-
async getGuildTemplates(
|
1737
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplates(
|
1736
|
+
async getGuildTemplates(guildID) {
|
1737
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplates(guildID));
|
1738
1738
|
return response.map((guildTemplate) => this.util.guildTemplateFromRaw(guildTemplate));
|
1739
1739
|
}
|
1740
1740
|
/** https://discord.com/developers/docs/resources/guild#get-guild-vanity-url */
|
1741
|
-
getGuildVanityURL(
|
1742
|
-
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVanityURL(
|
1741
|
+
getGuildVanityURL(guildID) {
|
1742
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVanityURL(guildID));
|
1743
1743
|
}
|
1744
1744
|
/** https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */
|
1745
|
-
async getGuildVoiceRegions(
|
1746
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceRegions(
|
1745
|
+
async getGuildVoiceRegions(guildID) {
|
1746
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceRegions(guildID));
|
1747
1747
|
return response.map((voiceRegion) => ({
|
1748
1748
|
id: voiceRegion.id,
|
1749
1749
|
name: voiceRegion.name,
|
@@ -1753,21 +1753,21 @@ class Client extends node_events_1.default {
|
|
1753
1753
|
}));
|
1754
1754
|
}
|
1755
1755
|
/** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
|
1756
|
-
async getGuildWelcomeScreen(
|
1757
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWelcomeScreen(
|
1756
|
+
async getGuildWelcomeScreen(guildID) {
|
1757
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWelcomeScreen(guildID));
|
1758
1758
|
return {
|
1759
1759
|
description: response.description,
|
1760
1760
|
welcomeChannels: response.welcome_channels.map((welcomeScreenChannel) => ({
|
1761
|
-
|
1761
|
+
channelID: welcomeScreenChannel.channel_id,
|
1762
1762
|
description: welcomeScreenChannel.description,
|
1763
|
-
|
1763
|
+
emojiID: welcomeScreenChannel.emoji_id,
|
1764
1764
|
emojiName: welcomeScreenChannel.emoji_name,
|
1765
1765
|
})),
|
1766
1766
|
};
|
1767
1767
|
}
|
1768
1768
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget */
|
1769
|
-
async getGuildWidget(
|
1770
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetJSON(
|
1769
|
+
async getGuildWidget(guildID) {
|
1770
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetJSON(guildID));
|
1771
1771
|
return {
|
1772
1772
|
id: response.id,
|
1773
1773
|
name: response.name,
|
@@ -1778,35 +1778,35 @@ class Client extends node_events_1.default {
|
|
1778
1778
|
};
|
1779
1779
|
}
|
1780
1780
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
|
1781
|
-
getGuildWidgetImage(
|
1782
|
-
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetImage(
|
1781
|
+
getGuildWidgetImage(guildID, options) {
|
1782
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetImage(guildID), {
|
1783
1783
|
query: {
|
1784
1784
|
style: options?.style,
|
1785
1785
|
},
|
1786
1786
|
});
|
1787
1787
|
}
|
1788
1788
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-settings */
|
1789
|
-
async getGuildWidgetSettings(
|
1790
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetSettings(
|
1789
|
+
async getGuildWidgetSettings(guildID) {
|
1790
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetSettings(guildID));
|
1791
1791
|
return {
|
1792
1792
|
enabled: response.enabled,
|
1793
|
-
|
1793
|
+
channelID: response.channel_id,
|
1794
1794
|
};
|
1795
1795
|
}
|
1796
1796
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message */
|
1797
|
-
async getInteractionFollowupMessage(
|
1798
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(
|
1797
|
+
async getInteractionFollowupMessage(applicationID, interactionToken, messageID, options) {
|
1798
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(applicationID, interactionToken, messageID), {
|
1799
1799
|
query: {
|
1800
|
-
thread_id: options?.
|
1800
|
+
thread_id: options?.threadID,
|
1801
1801
|
},
|
1802
1802
|
});
|
1803
1803
|
return this.util.messageFromRaw(response);
|
1804
1804
|
}
|
1805
1805
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response */
|
1806
|
-
async getInteractionResponse(
|
1807
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(
|
1806
|
+
async getInteractionResponse(applicationID, interactionToken, options) {
|
1807
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(applicationID, interactionToken), {
|
1808
1808
|
query: {
|
1809
|
-
thread_id: options?.
|
1809
|
+
thread_id: options?.threadID,
|
1810
1810
|
},
|
1811
1811
|
});
|
1812
1812
|
return this.util.messageFromRaw(response);
|
@@ -1817,14 +1817,14 @@ class Client extends node_events_1.default {
|
|
1817
1817
|
query: {
|
1818
1818
|
with_counts: options?.withCounts,
|
1819
1819
|
with_expiration: options?.withExpiration,
|
1820
|
-
guild_scheduled_event_id: options?.
|
1820
|
+
guild_scheduled_event_id: options?.guildScheduledEventID,
|
1821
1821
|
},
|
1822
1822
|
});
|
1823
1823
|
return this.util.inviteFromRaw(response);
|
1824
1824
|
}
|
1825
1825
|
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
1826
|
-
async getJoinedPrivateArchivedThreads(
|
1827
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(
|
1826
|
+
async getJoinedPrivateArchivedThreads(channelID, options) {
|
1827
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(channelID, "private", true), {
|
1828
1828
|
query: {
|
1829
1829
|
before: options?.before,
|
1830
1830
|
limit: options?.limit,
|
@@ -1837,13 +1837,13 @@ class Client extends node_events_1.default {
|
|
1837
1837
|
};
|
1838
1838
|
}
|
1839
1839
|
/** https://discord.com/developers/docs/resources/channel#get-channel-message */
|
1840
|
-
async getMessage(
|
1841
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(
|
1840
|
+
async getMessage(channelID, messageID) {
|
1841
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelID, messageID));
|
1842
1842
|
return this.util.messageFromRaw(response);
|
1843
1843
|
}
|
1844
1844
|
/** https://discord.com/developers/docs/resources/channel#get-reactions */
|
1845
|
-
async getMessageReactions(
|
1846
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessageAllReactions(
|
1845
|
+
async getMessageReactions(channelID, messageID, emoji, options) {
|
1846
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessageAllReactions(channelID, messageID, emoji), {
|
1847
1847
|
query: {
|
1848
1848
|
type: options?.type,
|
1849
1849
|
after: options?.after,
|
@@ -1853,8 +1853,8 @@ class Client extends node_events_1.default {
|
|
1853
1853
|
return response.map((user) => this.util.userFromRaw(user));
|
1854
1854
|
}
|
1855
1855
|
/** https://discord.com/developers/docs/resources/channel#get-channel-messages */
|
1856
|
-
async getMessages(
|
1857
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessages(
|
1856
|
+
async getMessages(channelID, options) {
|
1857
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessages(channelID), {
|
1858
1858
|
query: {
|
1859
1859
|
around: options.around,
|
1860
1860
|
before: options.before,
|
@@ -1882,13 +1882,13 @@ class Client extends node_events_1.default {
|
|
1882
1882
|
};
|
1883
1883
|
}
|
1884
1884
|
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
1885
|
-
async getPinnedMessages(
|
1886
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(
|
1885
|
+
async getPinnedMessages(channelID) {
|
1886
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelID));
|
1887
1887
|
return response.map((message) => this.util.messageFromRaw(message));
|
1888
1888
|
}
|
1889
1889
|
/** https://discord.com/developers/docs/resources/poll#get-answer-voters */
|
1890
|
-
async getPollAnswerVoters(
|
1891
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.pollAnswerVoters(
|
1890
|
+
async getPollAnswerVoters(channelID, messageID, answerID, options) {
|
1891
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.pollAnswerVoters(channelID, messageID, answerID), {
|
1892
1892
|
query: {
|
1893
1893
|
after: options?.after,
|
1894
1894
|
limit: options?.limit,
|
@@ -1899,13 +1899,13 @@ class Client extends node_events_1.default {
|
|
1899
1899
|
};
|
1900
1900
|
}
|
1901
1901
|
/** https://discord.com/developers/docs/monetization/skus#list-skus */
|
1902
|
-
async getSKUs(
|
1903
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationSKUs(
|
1902
|
+
async getSKUs(applicationID) {
|
1903
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationSKUs(applicationID));
|
1904
1904
|
return response.map((sku) => this.util.skuFromRaw(sku));
|
1905
1905
|
}
|
1906
1906
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
1907
|
-
async getStageInstance(
|
1908
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stageInstance(
|
1907
|
+
async getStageInstance(channelID) {
|
1908
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stageInstance(channelID));
|
1909
1909
|
return this.util.stageInstanceFromRaw(response);
|
1910
1910
|
}
|
1911
1911
|
/** https://discord.com/developers/docs/resources/sticker#list-sticker-packs */
|
@@ -1916,23 +1916,23 @@ class Client extends node_events_1.default {
|
|
1916
1916
|
id: stickerPack.id,
|
1917
1917
|
stickers: stickerPack.stickers.map((sticker) => this.util.stickerFromRaw(sticker)),
|
1918
1918
|
name: stickerPack.name,
|
1919
|
-
|
1920
|
-
|
1919
|
+
skuID: stickerPack.sku_id,
|
1920
|
+
coverStickerID: stickerPack.cover_sticker_id,
|
1921
1921
|
description: stickerPack.description,
|
1922
|
-
|
1922
|
+
bannerAssetID: stickerPack.banner_asset_id,
|
1923
1923
|
})),
|
1924
1924
|
};
|
1925
1925
|
}
|
1926
1926
|
/** https://discord.com/developers/docs/resources/channel#get-thread-member */
|
1927
|
-
async getThreadMember(
|
1928
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(
|
1927
|
+
async getThreadMember(channelID, userID, options) {
|
1928
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(channelID, userID), {
|
1929
1929
|
query: {
|
1930
1930
|
with_member: options?.withMember,
|
1931
1931
|
},
|
1932
1932
|
});
|
1933
1933
|
return {
|
1934
1934
|
id: response.id,
|
1935
|
-
|
1935
|
+
userID: response.user_id,
|
1936
1936
|
joinTimestamp: response.join_timestamp,
|
1937
1937
|
flags: response.flags,
|
1938
1938
|
member: response.member !== undefined
|
@@ -1941,8 +1941,8 @@ class Client extends node_events_1.default {
|
|
1941
1941
|
};
|
1942
1942
|
}
|
1943
1943
|
/** https://discord.com/developers/docs/resources/channel#list-thread-members */
|
1944
|
-
async getThreadMembers(
|
1945
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(
|
1944
|
+
async getThreadMembers(channelID, options) {
|
1945
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(channelID), {
|
1946
1946
|
query: {
|
1947
1947
|
with_member: options?.withMember,
|
1948
1948
|
after: options?.after,
|
@@ -1952,8 +1952,8 @@ class Client extends node_events_1.default {
|
|
1952
1952
|
return response.map((threadMember) => this.util.threadMemberFromRaw(threadMember));
|
1953
1953
|
}
|
1954
1954
|
/** https://discord.com/developers/docs/resources/user#get-user */
|
1955
|
-
async getUser(
|
1956
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.user(
|
1955
|
+
async getUser(userID) {
|
1956
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.user(userID));
|
1957
1957
|
return this.util.userFromRaw(response);
|
1958
1958
|
}
|
1959
1959
|
/** https://discord.com/developers/docs/resources/voice#list-voice-regions */
|
@@ -1968,49 +1968,49 @@ class Client extends node_events_1.default {
|
|
1968
1968
|
}));
|
1969
1969
|
}
|
1970
1970
|
/** https://discord.com/developers/docs/resources/webhook#get-webhook-message */
|
1971
|
-
async getWebhookMessage(
|
1972
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(
|
1971
|
+
async getWebhookMessage(webhookID, webhookToken, messageID, options) {
|
1972
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(webhookID, webhookToken, messageID), {
|
1973
1973
|
query: {
|
1974
|
-
thread_id: options?.
|
1974
|
+
thread_id: options?.threadID,
|
1975
1975
|
},
|
1976
1976
|
});
|
1977
1977
|
return this.util.messageFromRaw(response);
|
1978
1978
|
}
|
1979
1979
|
/** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
|
1980
|
-
async getWebhooks(
|
1981
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(
|
1980
|
+
async getWebhooks(guildID) {
|
1981
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(guildID));
|
1982
1982
|
return response.map((webhook) => this.util.webhookFromRaw(webhook));
|
1983
1983
|
}
|
1984
1984
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
1985
|
-
joinThread(
|
1986
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(
|
1985
|
+
joinThread(channelID) {
|
1986
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelID, "@me"));
|
1987
1987
|
}
|
1988
1988
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
1989
|
-
joinVoiceChannel(
|
1990
|
-
this.shards.get(this.guildShardMap[
|
1989
|
+
joinVoiceChannel(guildID, channelID, options) {
|
1990
|
+
this.shards.get(this.guildShardMap[guildID])?.ws.send(JSON.stringify({
|
1991
1991
|
op: constants_1.GatewayOPCodes.VoiceStateUpdate,
|
1992
1992
|
d: {
|
1993
|
-
guild_id:
|
1994
|
-
channel_id:
|
1993
|
+
guild_id: guildID,
|
1994
|
+
channel_id: channelID,
|
1995
1995
|
self_mute: !!options?.selfMute,
|
1996
1996
|
self_deaf: !!options?.selfDeaf,
|
1997
1997
|
},
|
1998
1998
|
}));
|
1999
1999
|
}
|
2000
2000
|
/** https://discord.com/developers/docs/resources/user#leave-guild */
|
2001
|
-
leaveGuild(
|
2002
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(
|
2001
|
+
leaveGuild(guildID) {
|
2002
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(guildID));
|
2003
2003
|
}
|
2004
2004
|
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
2005
|
-
leaveThread(
|
2006
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(
|
2005
|
+
leaveThread(channelID) {
|
2006
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelID, "@me"));
|
2007
2007
|
}
|
2008
2008
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
2009
|
-
leaveVoiceChannel(
|
2010
|
-
this.shards.get(this.guildShardMap[
|
2009
|
+
leaveVoiceChannel(guildID) {
|
2010
|
+
this.shards.get(this.guildShardMap[guildID])?.ws.send(JSON.stringify({
|
2011
2011
|
op: constants_1.GatewayOPCodes.VoiceStateUpdate,
|
2012
2012
|
d: {
|
2013
|
-
guild_id:
|
2013
|
+
guild_id: guildID,
|
2014
2014
|
channel_id: null,
|
2015
2015
|
self_mute: false,
|
2016
2016
|
self_deaf: false,
|
@@ -2018,40 +2018,40 @@ class Client extends node_events_1.default {
|
|
2018
2018
|
}));
|
2019
2019
|
}
|
2020
2020
|
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
2021
|
-
pinMessage(
|
2022
|
-
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(
|
2021
|
+
pinMessage(channelID, messageID, reason) {
|
2022
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(channelID, messageID), {
|
2023
2023
|
reason,
|
2024
2024
|
});
|
2025
2025
|
}
|
2026
2026
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
|
2027
|
-
removeBan(
|
2028
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildBan(
|
2027
|
+
removeBan(guildID, userID, reason) {
|
2028
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildBan(guildID, userID), {
|
2029
2029
|
reason,
|
2030
2030
|
});
|
2031
2031
|
}
|
2032
2032
|
/** https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient */
|
2033
|
-
removeGroupRecipient(
|
2034
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelRecipient(
|
2033
|
+
removeGroupRecipient(channelID, userID) {
|
2034
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelRecipient(channelID, userID));
|
2035
2035
|
}
|
2036
2036
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member */
|
2037
|
-
removeGuildMember(
|
2038
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMember(
|
2037
|
+
removeGuildMember(guildID, userID, reason) {
|
2038
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMember(guildID, userID), {
|
2039
2039
|
reason,
|
2040
2040
|
});
|
2041
2041
|
}
|
2042
2042
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
2043
|
-
removeGuildMemberRole(
|
2044
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMemberRole(
|
2043
|
+
removeGuildMemberRole(guildID, userID, roleID, reason) {
|
2044
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMemberRole(guildID, userID, roleID), {
|
2045
2045
|
reason,
|
2046
2046
|
});
|
2047
2047
|
}
|
2048
2048
|
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
2049
|
-
removeThreadMember(
|
2050
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(
|
2049
|
+
removeThreadMember(channelID, userID) {
|
2050
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelID, userID));
|
2051
2051
|
}
|
2052
2052
|
/** https://discord.com/developers/docs/resources/guild#search-guild-members */
|
2053
|
-
async searchGuildMembers(
|
2054
|
-
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembersSearch(
|
2053
|
+
async searchGuildMembers(guildID, options) {
|
2054
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembersSearch(guildID), {
|
2055
2055
|
query: {
|
2056
2056
|
query: options.query,
|
2057
2057
|
limit: options.limit,
|
@@ -2065,17 +2065,17 @@ class Client extends node_events_1.default {
|
|
2065
2065
|
shard.updatePresence(options);
|
2066
2066
|
}
|
2067
2067
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
2068
|
-
async syncGuildTemplate(
|
2069
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildTemplate(
|
2068
|
+
async syncGuildTemplate(guildID, code) {
|
2069
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildTemplate(guildID, code));
|
2070
2070
|
return this.util.guildTemplateFromRaw(response);
|
2071
2071
|
}
|
2072
2072
|
/** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
|
2073
|
-
triggerTypingIndicator(
|
2074
|
-
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(
|
2073
|
+
triggerTypingIndicator(channelID) {
|
2074
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(channelID));
|
2075
2075
|
}
|
2076
2076
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
2077
|
-
async updateApplicationRoleConnectionMetadataRecords(
|
2078
|
-
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationRoleConnectionMetadata(
|
2077
|
+
async updateApplicationRoleConnectionMetadataRecords(applicationID) {
|
2078
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationID));
|
2079
2079
|
return response.map((applicationRoleConnectionMetadata) => ({
|
2080
2080
|
type: applicationRoleConnectionMetadata.type,
|
2081
2081
|
key: applicationRoleConnectionMetadata.key,
|
@@ -2108,8 +2108,8 @@ class Client extends node_events_1.default {
|
|
2108
2108
|
};
|
2109
2109
|
}
|
2110
2110
|
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
2111
|
-
unpinMessage(
|
2112
|
-
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPin(
|
2111
|
+
unpinMessage(channelID, messageID, reason) {
|
2112
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPin(channelID, messageID), {
|
2113
2113
|
reason,
|
2114
2114
|
});
|
2115
2115
|
}
|