disgroove 2.0.0-dev.825fc77 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/lib/Client.d.ts +10 -10
- package/dist/lib/Client.js +189 -189
- package/dist/lib/Client.js.map +1 -1
- package/dist/lib/constants.d.ts +3 -3
- package/dist/lib/constants.js +207 -207
- package/dist/lib/rest/Endpoints.d.ts +1 -1
- package/dist/lib/rest/Endpoints.js +3 -3
- package/dist/lib/rest/Endpoints.js.map +1 -1
- package/dist/lib/rest/RequestManager.d.ts +2 -2
- package/dist/lib/rest/RequestManager.js +17 -17
- package/dist/lib/types/application-command.d.ts +5 -5
- package/dist/lib/types/guild.d.ts +4 -4
- package/dist/lib/types/interaction.d.ts +6 -6
- package/dist/lib/utils/errors.d.ts +1 -1
- package/dist/lib/utils/errors.js +4 -4
- package/dist/package.json +9 -7
- package/package.json +9 -7
package/dist/lib/Client.js
CHANGED
@@ -39,7 +39,7 @@ class Client extends node_events_1.default {
|
|
39
39
|
}
|
40
40
|
/** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient */
|
41
41
|
addGroupRecipient(channelId, userId, options) {
|
42
|
-
this.rest.request(rest_1.
|
42
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelRecipient(channelId, userId), {
|
43
43
|
json: {
|
44
44
|
access_token: options.accessToken,
|
45
45
|
nick: options.nick,
|
@@ -49,7 +49,7 @@ class Client extends node_events_1.default {
|
|
49
49
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member */
|
50
50
|
addGuildMember(guildId, userId, options) {
|
51
51
|
return this.rest
|
52
|
-
.request(rest_1.
|
52
|
+
.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,
|
@@ -62,18 +62,18 @@ class Client extends node_events_1.default {
|
|
62
62
|
}
|
63
63
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
|
64
64
|
addGuildMemberRole(guildId, userId, roleId, reason) {
|
65
|
-
this.rest.request(rest_1.
|
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
70
|
addThreadMember(channelId, userId) {
|
71
|
-
this.rest.request(rest_1.
|
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
74
|
beginGuildPrune(guildId, options, reason) {
|
75
75
|
return this.rest
|
76
|
-
.request(rest_1.
|
76
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildPrune(guildId), {
|
77
77
|
json: {
|
78
78
|
days: options.days,
|
79
79
|
compute_prune_count: options.computePruneCount,
|
@@ -86,7 +86,7 @@ class Client extends node_events_1.default {
|
|
86
86
|
}
|
87
87
|
/** https://discord.com/developers/docs/resources/channel#bulk-delete-messages */
|
88
88
|
bulkDeleteMessages(channelId, options, reason) {
|
89
|
-
this.rest.request(rest_1.
|
89
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelBulkDelete(channelId), {
|
90
90
|
json: {
|
91
91
|
messages: options?.messagesIds,
|
92
92
|
},
|
@@ -96,7 +96,7 @@ class Client extends node_events_1.default {
|
|
96
96
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
|
97
97
|
bulkEditGlobalApplicationCommands(applicationId, commands) {
|
98
98
|
return this.rest
|
99
|
-
.request(rest_1.
|
99
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommands(applicationId), {
|
100
100
|
json: commands.map((command) => this.util.toSnakeCase(command)),
|
101
101
|
})
|
102
102
|
.then((response) => response.map((applicationCommand) => this.util.toCamelCase(applicationCommand)));
|
@@ -104,7 +104,7 @@ class Client extends node_events_1.default {
|
|
104
104
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
|
105
105
|
bulkEditGuildApplicationCommands(applicationId, guildId, commands) {
|
106
106
|
return this.rest
|
107
|
-
.request(rest_1.
|
107
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationGuildCommands(applicationId, guildId), {
|
108
108
|
json: commands.map((command) => this.util.toSnakeCase(command)),
|
109
109
|
})
|
110
110
|
.then((response) => response.map((applicationCommand) => this.util.toCamelCase(applicationCommand)));
|
@@ -122,7 +122,7 @@ class Client extends node_events_1.default {
|
|
122
122
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
123
123
|
createAutoModerationRule(guildId, options, reason) {
|
124
124
|
return this.rest
|
125
|
-
.request(rest_1.
|
125
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildAutoModerationRules(guildId), {
|
126
126
|
json: {
|
127
127
|
name: options.name,
|
128
128
|
event_type: options.eventType,
|
@@ -140,7 +140,7 @@ class Client extends node_events_1.default {
|
|
140
140
|
/** https://discord.com/developers/docs/resources/guild#create-guild-channel */
|
141
141
|
createChannel(guildId, options, reason) {
|
142
142
|
return this.rest
|
143
|
-
.request(rest_1.
|
143
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildChannels(guildId), {
|
144
144
|
json: {
|
145
145
|
name: options.name,
|
146
146
|
type: options.type,
|
@@ -172,7 +172,7 @@ class Client extends node_events_1.default {
|
|
172
172
|
/** https://discord.com/developers/docs/resources/channel#create-channel-invite */
|
173
173
|
createChannelInvite(channelId, options, reason) {
|
174
174
|
return this.rest
|
175
|
-
.request(rest_1.
|
175
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelInvites(channelId), {
|
176
176
|
json: {
|
177
177
|
max_age: options.maxAge,
|
178
178
|
max_uses: options.maxUses,
|
@@ -189,7 +189,7 @@ class Client extends node_events_1.default {
|
|
189
189
|
/** https://discord.com/developers/docs/resources/webhook#create-webhook */
|
190
190
|
createChannelWebhook(channelId, options, reason) {
|
191
191
|
return this.rest
|
192
|
-
.request(rest_1.
|
192
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelWebhooks(channelId), {
|
193
193
|
json: {
|
194
194
|
name: options.name,
|
195
195
|
avatar: options.avatar,
|
@@ -201,7 +201,7 @@ class Client extends node_events_1.default {
|
|
201
201
|
/** https://discord.com/developers/docs/resources/user#create-dm */
|
202
202
|
createDM(options) {
|
203
203
|
return this.rest
|
204
|
-
.request(rest_1.
|
204
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.userChannels(), {
|
205
205
|
json: {
|
206
206
|
recipient_id: options.recipientId,
|
207
207
|
},
|
@@ -211,7 +211,7 @@ class Client extends node_events_1.default {
|
|
211
211
|
/** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */
|
212
212
|
createGlobalApplicationCommand(applicationId, options) {
|
213
213
|
return this.rest
|
214
|
-
.request(rest_1.
|
214
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationCommands(applicationId), {
|
215
215
|
json: {
|
216
216
|
type: options.type,
|
217
217
|
name: options.name,
|
@@ -230,7 +230,7 @@ class Client extends node_events_1.default {
|
|
230
230
|
/** https://discord.com/developers/docs/resources/user#create-group-dm */
|
231
231
|
createGroupDM(options) {
|
232
232
|
return this.rest
|
233
|
-
.request(rest_1.
|
233
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.userChannels(), {
|
234
234
|
json: {
|
235
235
|
access_tokens: options.accessTokens,
|
236
236
|
nicks: options.nicks,
|
@@ -241,7 +241,7 @@ class Client extends node_events_1.default {
|
|
241
241
|
/** https://discord.com/developers/docs/resources/guild#create-guild */
|
242
242
|
createGuild(options) {
|
243
243
|
return this.rest
|
244
|
-
.request(rest_1.
|
244
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guilds(), {
|
245
245
|
json: {
|
246
246
|
name: options.name,
|
247
247
|
region: options.region,
|
@@ -262,7 +262,7 @@ class Client extends node_events_1.default {
|
|
262
262
|
/** https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command */
|
263
263
|
createGuildApplicationCommand(applicationId, guildId, options) {
|
264
264
|
return this.rest
|
265
|
-
.request(rest_1.
|
265
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationGuildCommands(applicationId, guildId), {
|
266
266
|
json: {
|
267
267
|
type: options.type,
|
268
268
|
name: options.name,
|
@@ -279,7 +279,7 @@ class Client extends node_events_1.default {
|
|
279
279
|
}
|
280
280
|
/** https://discord.com/developers/docs/resources/guild#create-guild-ban */
|
281
281
|
createGuildBan(guildId, userId, options, reason) {
|
282
|
-
this.rest.request(rest_1.
|
282
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildBan(guildId, userId), {
|
283
283
|
json: {
|
284
284
|
delete_message_days: options?.deleteMessageDays,
|
285
285
|
delete_message_seconds: options?.deleteMessageSeconds,
|
@@ -290,7 +290,7 @@ class Client extends node_events_1.default {
|
|
290
290
|
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
|
291
291
|
createGuildEmoji(guildId, options, reason) {
|
292
292
|
return this.rest
|
293
|
-
.request(rest_1.
|
293
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildEmojis(guildId), {
|
294
294
|
json: {
|
295
295
|
name: options.name,
|
296
296
|
image: options.image,
|
@@ -303,7 +303,7 @@ class Client extends node_events_1.default {
|
|
303
303
|
/** https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template */
|
304
304
|
createGuildFromTemplate(code, options) {
|
305
305
|
return this.rest
|
306
|
-
.request(rest_1.
|
306
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.template(code), {
|
307
307
|
json: {
|
308
308
|
name: options.name,
|
309
309
|
icon: options.icon,
|
@@ -314,7 +314,7 @@ class Client extends node_events_1.default {
|
|
314
314
|
/** https://discord.com/developers/docs/resources/guild#create-guild-role */
|
315
315
|
createGuildRole(guildId, options, reason) {
|
316
316
|
return this.rest
|
317
|
-
.request(rest_1.
|
317
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildRoles(guildId), {
|
318
318
|
json: {
|
319
319
|
name: options.name,
|
320
320
|
permissions: options.permissions,
|
@@ -331,7 +331,7 @@ class Client extends node_events_1.default {
|
|
331
331
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event */
|
332
332
|
createGuildScheduledEvent(guildId, options, reason) {
|
333
333
|
return this.rest
|
334
|
-
.request(rest_1.
|
334
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildScheduledEvents(guildId), {
|
335
335
|
json: {
|
336
336
|
channel_id: options.channelId,
|
337
337
|
entity_metadata: options.entityMetadata,
|
@@ -355,7 +355,7 @@ class Client extends node_events_1.default {
|
|
355
355
|
formData.set("tags", options.tags);
|
356
356
|
formData.set("file", new Blob([options.file.contents]), options.file.name);
|
357
357
|
return this.rest
|
358
|
-
.request(rest_1.
|
358
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildStickers(guildId), {
|
359
359
|
form: formData,
|
360
360
|
reason,
|
361
361
|
})
|
@@ -364,7 +364,7 @@ class Client extends node_events_1.default {
|
|
364
364
|
/** https://discord.com/developers/docs/resources/guild-template#create-guild-template */
|
365
365
|
createGuildTemplate(guildId, options) {
|
366
366
|
return this.rest
|
367
|
-
.request(rest_1.
|
367
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildTemplates(guildId), {
|
368
368
|
json: {
|
369
369
|
name: options.name,
|
370
370
|
description: options.description,
|
@@ -375,7 +375,7 @@ class Client extends node_events_1.default {
|
|
375
375
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */
|
376
376
|
createInteractionFollowupMessage(applicationId, interactionToken, options) {
|
377
377
|
return this.rest
|
378
|
-
.request(rest_1.
|
378
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(applicationId, interactionToken), {
|
379
379
|
json: {
|
380
380
|
content: options.content,
|
381
381
|
tts: options.tts,
|
@@ -408,7 +408,7 @@ class Client extends node_events_1.default {
|
|
408
408
|
case constants_1.InteractionCallbackType.ChannelMessageWithSource:
|
409
409
|
case constants_1.InteractionCallbackType.UpdateMessage:
|
410
410
|
{
|
411
|
-
this.rest.request(rest_1.
|
411
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionId, interactionToken), {
|
412
412
|
json: {
|
413
413
|
type: options.type,
|
414
414
|
data: {
|
@@ -433,7 +433,7 @@ class Client extends node_events_1.default {
|
|
433
433
|
case constants_1.InteractionCallbackType.DeferredChannelMessageWithSource:
|
434
434
|
case constants_1.InteractionCallbackType.DeferredUpdateMessage:
|
435
435
|
{
|
436
|
-
this.rest.request(rest_1.
|
436
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionId, interactionToken), {
|
437
437
|
json: {
|
438
438
|
type: options.type,
|
439
439
|
data: {
|
@@ -445,7 +445,7 @@ class Client extends node_events_1.default {
|
|
445
445
|
break;
|
446
446
|
case constants_1.InteractionCallbackType.ApplicationCommandAutocompleteResult:
|
447
447
|
{
|
448
|
-
this.rest.request(rest_1.
|
448
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionId, interactionToken), {
|
449
449
|
json: {
|
450
450
|
type: options.type,
|
451
451
|
data: {
|
@@ -457,7 +457,7 @@ class Client extends node_events_1.default {
|
|
457
457
|
break;
|
458
458
|
case constants_1.InteractionCallbackType.Modal:
|
459
459
|
{
|
460
|
-
this.rest.request(rest_1.
|
460
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionId, interactionToken), {
|
461
461
|
json: {
|
462
462
|
type: options.type,
|
463
463
|
data: {
|
@@ -473,7 +473,7 @@ class Client extends node_events_1.default {
|
|
473
473
|
break;
|
474
474
|
case constants_1.InteractionCallbackType.PremiumRequired:
|
475
475
|
{
|
476
|
-
this.rest.request(rest_1.
|
476
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.interactionCallback(interactionId, interactionToken), {
|
477
477
|
json: {
|
478
478
|
type: options.type,
|
479
479
|
data: {},
|
@@ -486,7 +486,7 @@ class Client extends node_events_1.default {
|
|
486
486
|
/** https://discord.com/developers/docs/resources/channel#create-message */
|
487
487
|
createMessage(channelId, options) {
|
488
488
|
return this.rest
|
489
|
-
.request(rest_1.
|
489
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelId), {
|
490
490
|
json: {
|
491
491
|
content: options.content,
|
492
492
|
nonce: options.nonce,
|
@@ -512,12 +512,12 @@ class Client extends node_events_1.default {
|
|
512
512
|
}
|
513
513
|
/** https://discord.com/developers/docs/resources/channel#create-reaction */
|
514
514
|
createMessageReaction(channelId, messageId, emoji) {
|
515
|
-
this.rest.request(rest_1.
|
515
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelMessageReaction(channelId, messageId, emoji));
|
516
516
|
}
|
517
517
|
/** https://discord.com/developers/docs/resources/stage-instance#create-stage-instance */
|
518
518
|
createStageInstance(options, reason) {
|
519
519
|
return this.rest
|
520
|
-
.request(rest_1.
|
520
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.stageInstances(), {
|
521
521
|
json: {
|
522
522
|
channel_id: options.channelId,
|
523
523
|
topic: options.topic,
|
@@ -532,7 +532,7 @@ class Client extends node_events_1.default {
|
|
532
532
|
/** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */
|
533
533
|
createTestEntitlement(applicationId, options) {
|
534
534
|
return this.rest
|
535
|
-
.request(rest_1.
|
535
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlements(applicationId), {
|
536
536
|
json: {
|
537
537
|
sku_id: options.skuId,
|
538
538
|
owner_id: options.ownerId,
|
@@ -544,7 +544,7 @@ class Client extends node_events_1.default {
|
|
544
544
|
/** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel */
|
545
545
|
createThread(channelId, options, reason) {
|
546
546
|
return this.rest
|
547
|
-
.request(rest_1.
|
547
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelId), {
|
548
548
|
json: {
|
549
549
|
name: options.name,
|
550
550
|
auto_archive_duration: options.autoArchiveDuration,
|
@@ -560,7 +560,7 @@ class Client extends node_events_1.default {
|
|
560
560
|
/** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
|
561
561
|
createThreadFromMessage(channelId, messageId, options, reason) {
|
562
562
|
return this.rest
|
563
|
-
.request(rest_1.
|
563
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelId, messageId), {
|
564
564
|
json: {
|
565
565
|
name: options.name,
|
566
566
|
auto_archive_duration: options.autoArchiveDuration,
|
@@ -573,7 +573,7 @@ class Client extends node_events_1.default {
|
|
573
573
|
/** https://discord.com/developers/docs/resources/channel#start-thread-without-message */
|
574
574
|
createThreadWithoutMessage(channelId, options, reason) {
|
575
575
|
return this.rest
|
576
|
-
.request(rest_1.
|
576
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.threads(channelId), {
|
577
577
|
json: {
|
578
578
|
name: options.name,
|
579
579
|
auto_archive_duration: options.autoArchiveDuration,
|
@@ -588,124 +588,124 @@ class Client extends node_events_1.default {
|
|
588
588
|
/** https://discord.com/developers/docs/resources/channel#crosspost-message */
|
589
589
|
crosspostMessage(channelId, messageId) {
|
590
590
|
return this.rest
|
591
|
-
.request(rest_1.
|
591
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessage(channelId, messageId))
|
592
592
|
.then((response) => this.util.toCamelCase(response));
|
593
593
|
}
|
594
594
|
/** https://discord.com/developers/docs/resources/channel#delete-all-reactions */
|
595
595
|
deleteAllMessageReactions(channelId, messageId, emoji) {
|
596
|
-
this.rest.request(rest_1.
|
596
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageAllReactions(channelId, messageId, emoji));
|
597
597
|
}
|
598
598
|
/** https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule */
|
599
599
|
deleteAutoModerationRule(guildId, autoModerationRuleId, reason) {
|
600
|
-
this.rest.request(rest_1.
|
600
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildAutoModerationRule(guildId, autoModerationRuleId), {
|
601
601
|
reason,
|
602
602
|
});
|
603
603
|
}
|
604
604
|
/** https://discord.com/developers/docs/resources/channel#deleteclose-channel */
|
605
605
|
deleteChannel(channelId, reason) {
|
606
606
|
return this.rest
|
607
|
-
.request(rest_1.
|
607
|
+
.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channel(channelId), {
|
608
608
|
reason,
|
609
609
|
})
|
610
610
|
.then((response) => this.util.toCamelCase(response));
|
611
611
|
}
|
612
612
|
/** https://discord.com/developers/docs/resources/channel#delete-channel-permission */
|
613
613
|
deleteChannelPermission(channelId, overwriteId, reason) {
|
614
|
-
this.rest.request(rest_1.
|
614
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPermission(channelId, overwriteId), {
|
615
615
|
reason,
|
616
616
|
});
|
617
617
|
}
|
618
618
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
|
619
619
|
deleteGlobalApplicationCommand(applicationId, commandId) {
|
620
|
-
this.rest.request(rest_1.
|
620
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationCommand(applicationId, commandId));
|
621
621
|
}
|
622
622
|
/** https://discord.com/developers/docs/resources/guild#delete-guild */
|
623
623
|
deleteGuild(guildId) {
|
624
|
-
this.rest.request(rest_1.
|
624
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guild(guildId));
|
625
625
|
}
|
626
626
|
/** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
|
627
627
|
deleteGuildApplicationCommand(applicationId, guildId, commandId) {
|
628
|
-
this.rest.request(rest_1.
|
628
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationGuildCommand(applicationId, guildId, commandId));
|
629
629
|
}
|
630
630
|
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
631
631
|
deleteGuildEmoji(guildId, emojiId, reason) {
|
632
|
-
this.rest.request(rest_1.
|
632
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildEmoji(guildId, emojiId), {
|
633
633
|
reason,
|
634
634
|
});
|
635
635
|
}
|
636
636
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-integration */
|
637
637
|
deleteGuildIntegration(guildId, integrationId, reason) {
|
638
|
-
this.rest.request(rest_1.
|
638
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildIntegration(guildId, integrationId), {
|
639
639
|
reason,
|
640
640
|
});
|
641
641
|
}
|
642
642
|
/** https://discord.com/developers/docs/resources/guild#delete-guild-role */
|
643
643
|
deleteGuildRole(guildId, roleId, reason) {
|
644
|
-
this.rest.request(rest_1.
|
644
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildRole(guildId, roleId), {
|
645
645
|
reason,
|
646
646
|
});
|
647
647
|
}
|
648
648
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event */
|
649
649
|
deleteGuildScheduledEvent(guildId, guildScheduledEventId) {
|
650
|
-
this.rest.request(rest_1.
|
650
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildScheduledEvent(guildId, guildScheduledEventId));
|
651
651
|
}
|
652
652
|
/** https://discord.com/developers/docs/resources/sticker#delete-guild-sticker */
|
653
653
|
deleteGuildSticker(guildId, stickerId, reason) {
|
654
|
-
this.rest.request(rest_1.
|
654
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildSticker(guildId, stickerId), {
|
655
655
|
reason,
|
656
656
|
});
|
657
657
|
}
|
658
658
|
/** https://discord.com/developers/docs/resources/guild-template#delete-guild-template */
|
659
659
|
deleteGuildTemplate(guildId, code) {
|
660
660
|
return this.rest
|
661
|
-
.request(rest_1.
|
661
|
+
.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildTemplate(guildId, code))
|
662
662
|
.then((response) => this.util.toCamelCase(response));
|
663
663
|
}
|
664
664
|
/** https://discord.com/developers/docs/resources/invite#delete-invite */
|
665
665
|
deleteInvite(code, reason) {
|
666
666
|
return this.rest
|
667
|
-
.request(rest_1.
|
667
|
+
.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.invite(code), {
|
668
668
|
reason,
|
669
669
|
})
|
670
670
|
.then((response) => this.util.toCamelCase(response));
|
671
671
|
}
|
672
672
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message */
|
673
673
|
deleteInteractionFollowupMessage(applicationId, interactionToken, messageId) {
|
674
|
-
this.rest.request(rest_1.
|
674
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationId, interactionToken, messageId));
|
675
675
|
}
|
676
676
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response */
|
677
677
|
deleteInteractionResponse(applicationId, interactionToken) {
|
678
|
-
this.rest.request(rest_1.
|
678
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationId, interactionToken));
|
679
679
|
}
|
680
680
|
/** https://discord.com/developers/docs/resources/channel#delete-message */
|
681
681
|
deleteMessage(channelId, messageId, reason) {
|
682
|
-
this.rest.request(rest_1.
|
682
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessage(channelId, messageId), {
|
683
683
|
reason,
|
684
684
|
});
|
685
685
|
}
|
686
686
|
/** https://discord.com/developers/docs/resources/channel#delete-user-reaction */
|
687
687
|
deleteMessageReaction(channelId, messageId, emoji, userId) {
|
688
|
-
this.rest.request(rest_1.
|
688
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessageReaction(channelId, messageId, emoji, userId));
|
689
689
|
}
|
690
690
|
/** https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance */
|
691
691
|
deleteStageInstance(channelId, reason) {
|
692
|
-
this.rest.request(rest_1.
|
692
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.stageInstance(channelId), {
|
693
693
|
reason,
|
694
694
|
});
|
695
695
|
}
|
696
696
|
/** https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement */
|
697
697
|
deleteTestEntitlement(applicationId, entitlementId) {
|
698
|
-
this.rest.request(rest_1.
|
698
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationEntitlement(applicationId, entitlementId));
|
699
699
|
}
|
700
700
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook */
|
701
701
|
deleteWebhook(webhookId, reason) {
|
702
|
-
this.rest.request(rest_1.
|
702
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(webhookId), {
|
703
703
|
reason,
|
704
704
|
});
|
705
705
|
}
|
706
706
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook-message */
|
707
707
|
deleteWebhookMessage(webhookId, webhookToken, messageId, options) {
|
708
|
-
this.rest.request(rest_1.
|
708
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(webhookId, webhookToken, messageId), {
|
709
709
|
query: {
|
710
710
|
thread_id: options?.threadId,
|
711
711
|
},
|
@@ -713,7 +713,7 @@ class Client extends node_events_1.default {
|
|
713
713
|
}
|
714
714
|
/** https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token */
|
715
715
|
deleteWebhookWithToken(webhookId, webhookToken, reason) {
|
716
|
-
this.rest.request(rest_1.
|
716
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhook(webhookId, webhookToken), {
|
717
717
|
reason,
|
718
718
|
authorization: false,
|
719
719
|
});
|
@@ -724,7 +724,7 @@ class Client extends node_events_1.default {
|
|
724
724
|
/** https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule */
|
725
725
|
editAutoModerationRule(guildId, autoModerationRuleId, options, reason) {
|
726
726
|
return this.rest
|
727
|
-
.request(rest_1.
|
727
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildAutoModerationRule(guildId, autoModerationRuleId), {
|
728
728
|
json: {
|
729
729
|
name: options.name,
|
730
730
|
event_type: options.eventType,
|
@@ -742,7 +742,7 @@ class Client extends node_events_1.default {
|
|
742
742
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions */
|
743
743
|
editApplicationCommandPermissions(applicationId, guildId, commandId, options) {
|
744
744
|
return this.rest
|
745
|
-
.request(rest_1.
|
745
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationCommandPermissions(applicationId, guildId, commandId), {
|
746
746
|
json: {
|
747
747
|
permissions: options.permissions.map((permission) => this.util.toSnakeCase(permission)),
|
748
748
|
},
|
@@ -752,7 +752,7 @@ class Client extends node_events_1.default {
|
|
752
752
|
/** https://discord.com/developers/docs/resources/channel#modify-channel */
|
753
753
|
editChannel(channelId, options, reason) {
|
754
754
|
return this.rest
|
755
|
-
.request(rest_1.
|
755
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channel(channelId), {
|
756
756
|
json: {
|
757
757
|
name: options.name,
|
758
758
|
type: options.type,
|
@@ -784,14 +784,14 @@ class Client extends node_events_1.default {
|
|
784
784
|
}
|
785
785
|
/** https://discord.com/developers/docs/resources/channel#edit-channel-permissions */
|
786
786
|
editChannelPermissions(channelId, overwriteId, options, reason) {
|
787
|
-
this.rest.request(rest_1.
|
787
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPermission(channelId, overwriteId), {
|
788
788
|
json: options,
|
789
789
|
reason,
|
790
790
|
});
|
791
791
|
}
|
792
792
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions */
|
793
793
|
editChannelPositions(guildId, options) {
|
794
|
-
this.rest.request(rest_1.
|
794
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildChannels(guildId), {
|
795
795
|
json: options.map((data) => ({
|
796
796
|
id: data.id,
|
797
797
|
position: data.position,
|
@@ -803,7 +803,7 @@ class Client extends node_events_1.default {
|
|
803
803
|
/** https://discord.com/developers/docs/resources/user#modify-current-user */
|
804
804
|
editCurrentUser(options) {
|
805
805
|
return this.rest
|
806
|
-
.request(rest_1.
|
806
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.user(), {
|
807
807
|
json: {
|
808
808
|
username: options.username,
|
809
809
|
avatar: options.avatar,
|
@@ -814,7 +814,7 @@ class Client extends node_events_1.default {
|
|
814
814
|
/** https://discord.com/developers/docs/resources/guild#modify-current-member */
|
815
815
|
editCurrentGuildMember(guildId, options, reason) {
|
816
816
|
return this.rest
|
817
|
-
.request(rest_1.
|
817
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(guildId), {
|
818
818
|
json: {
|
819
819
|
nick: options.nick,
|
820
820
|
},
|
@@ -824,7 +824,7 @@ class Client extends node_events_1.default {
|
|
824
824
|
}
|
825
825
|
/** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state */
|
826
826
|
editCurrentUserVoiceState(guildId, options) {
|
827
|
-
this.rest.request(rest_1.
|
827
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(guildId), {
|
828
828
|
json: {
|
829
829
|
channel_id: options.channelId,
|
830
830
|
suppress: options.suppress,
|
@@ -835,7 +835,7 @@ class Client extends node_events_1.default {
|
|
835
835
|
/** https://discord.com/developers/docs/resources/application#edit-current-application */
|
836
836
|
editCurrentApplication(options) {
|
837
837
|
return this.rest
|
838
|
-
.request(rest_1.
|
838
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationCurrentUser(), {
|
839
839
|
json: {
|
840
840
|
custom_install_url: options.customInstallUrl,
|
841
841
|
description: options.description,
|
@@ -853,7 +853,7 @@ class Client extends node_events_1.default {
|
|
853
853
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command */
|
854
854
|
editGlobalApplicationCommand(applicationId, commandId, options) {
|
855
855
|
return this.rest
|
856
|
-
.request(rest_1.
|
856
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationCommand(applicationId, commandId), {
|
857
857
|
json: {
|
858
858
|
name: options.name,
|
859
859
|
name_localizations: options.nameLocalizations,
|
@@ -871,7 +871,7 @@ class Client extends node_events_1.default {
|
|
871
871
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
872
872
|
editGuild(guildId, options, reason) {
|
873
873
|
return this.rest
|
874
|
-
.request(rest_1.
|
874
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guild(guildId), {
|
875
875
|
json: {
|
876
876
|
name: options.name,
|
877
877
|
region: options.region,
|
@@ -902,7 +902,7 @@ class Client extends node_events_1.default {
|
|
902
902
|
/** https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command */
|
903
903
|
editGuildApplicationCommand(applicationId, guildId, commandId, options) {
|
904
904
|
return this.rest
|
905
|
-
.request(rest_1.
|
905
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.applicationGuildCommand(applicationId, guildId, commandId), {
|
906
906
|
json: {
|
907
907
|
name: options.name,
|
908
908
|
name_localizations: options.nameLocalizations,
|
@@ -919,7 +919,7 @@ class Client extends node_events_1.default {
|
|
919
919
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
|
920
920
|
editGuildEmoji(guildId, emojiId, options, reason) {
|
921
921
|
return this.rest
|
922
|
-
.request(rest_1.
|
922
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildEmoji(guildId, emojiId), {
|
923
923
|
json: {
|
924
924
|
name: options.name,
|
925
925
|
roles: options.roles,
|
@@ -931,7 +931,7 @@ class Client extends node_events_1.default {
|
|
931
931
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-member */
|
932
932
|
editGuildMember(guildId, userId, options, reason) {
|
933
933
|
return this.rest
|
934
|
-
.request(rest_1.
|
934
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildMember(guildId, userId), {
|
935
935
|
json: {
|
936
936
|
nick: options.nick,
|
937
937
|
roles: options.roles,
|
@@ -947,7 +947,7 @@ class Client extends node_events_1.default {
|
|
947
947
|
}
|
948
948
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level */
|
949
949
|
editGuildMFALevel(guildId, options, reason) {
|
950
|
-
return this.rest.request(rest_1.
|
950
|
+
return this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.guildMFA(guildId), {
|
951
951
|
json: {
|
952
952
|
level: options.level,
|
953
953
|
},
|
@@ -956,7 +956,7 @@ class Client extends node_events_1.default {
|
|
956
956
|
}
|
957
957
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */
|
958
958
|
editGuildOnboarding(guildId, options, reason) {
|
959
|
-
this.rest.request(rest_1.
|
959
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildOnboarding(guildId), {
|
960
960
|
json: {
|
961
961
|
prompts: options.prompts.map((prompt) => this.util.toSnakeCase(prompt)),
|
962
962
|
},
|
@@ -966,7 +966,7 @@ class Client extends node_events_1.default {
|
|
966
966
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role */
|
967
967
|
editGuildRole(guildId, roleId, options, reason) {
|
968
968
|
return this.rest
|
969
|
-
.request(rest_1.
|
969
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRole(guildId, roleId), {
|
970
970
|
json: {
|
971
971
|
name: options?.name,
|
972
972
|
permissions: options?.permissions,
|
@@ -983,7 +983,7 @@ class Client extends node_events_1.default {
|
|
983
983
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-role-positions */
|
984
984
|
editGuildRolePositions(guildId, options) {
|
985
985
|
return this.rest
|
986
|
-
.request(rest_1.
|
986
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildRoles(guildId), {
|
987
987
|
json: options.map((role) => this.util.toSnakeCase(role)),
|
988
988
|
})
|
989
989
|
.then((response) => response.map((role) => this.util.toCamelCase(role)));
|
@@ -991,7 +991,7 @@ class Client extends node_events_1.default {
|
|
991
991
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event */
|
992
992
|
editGuildScheduledEvent(guildId, guildScheduledEventId, options, reason) {
|
993
993
|
return this.rest
|
994
|
-
.request(rest_1.
|
994
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildScheduledEvent(guildId, guildScheduledEventId), {
|
995
995
|
json: {
|
996
996
|
channel_id: options.channelId,
|
997
997
|
entity_metadata: options.entityMetadata,
|
@@ -1011,7 +1011,7 @@ class Client extends node_events_1.default {
|
|
1011
1011
|
/** https://discord.com/developers/docs/resources/sticker#modify-guild-sticker */
|
1012
1012
|
editGuildSticker(guildId, stickerId, options, reason) {
|
1013
1013
|
return this.rest
|
1014
|
-
.request(rest_1.
|
1014
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildSticker(guildId, stickerId), {
|
1015
1015
|
json: {
|
1016
1016
|
name: options.name,
|
1017
1017
|
description: options.description,
|
@@ -1024,7 +1024,7 @@ class Client extends node_events_1.default {
|
|
1024
1024
|
/** https://discord.com/developers/docs/resources/guild-template#modify-guild-template */
|
1025
1025
|
editGuildTemplate(guildId, code, options) {
|
1026
1026
|
return this.rest
|
1027
|
-
.request(rest_1.
|
1027
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildTemplate(guildId, code), {
|
1028
1028
|
json: {
|
1029
1029
|
name: options.name,
|
1030
1030
|
description: options.description,
|
@@ -1035,7 +1035,7 @@ class Client extends node_events_1.default {
|
|
1035
1035
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen */
|
1036
1036
|
editGuildWelcomeScreen(guildId, options, reason) {
|
1037
1037
|
return this.rest
|
1038
|
-
.request(rest_1.
|
1038
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWelcomeScreen(guildId), {
|
1039
1039
|
json: {
|
1040
1040
|
enabled: options.enabled,
|
1041
1041
|
welcome_channels: options.welcomeChannels,
|
@@ -1048,7 +1048,7 @@ class Client extends node_events_1.default {
|
|
1048
1048
|
/** https://discord.com/developers/docs/resources/guild#modify-guild-widget */
|
1049
1049
|
editGuildWidget(guildId, options, reason) {
|
1050
1050
|
return this.rest
|
1051
|
-
.request(rest_1.
|
1051
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildWidgetSettings(guildId), {
|
1052
1052
|
json: {
|
1053
1053
|
enabled: options.enabled,
|
1054
1054
|
channel_id: options.channelId,
|
@@ -1060,7 +1060,7 @@ class Client extends node_events_1.default {
|
|
1060
1060
|
/** https://discord.com/developers/docs/resources/channel#edit-message */
|
1061
1061
|
editMessage(channelId, messageId, options) {
|
1062
1062
|
return this.rest
|
1063
|
-
.request(rest_1.
|
1063
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channelMessage(channelId, messageId), {
|
1064
1064
|
json: {
|
1065
1065
|
content: options.content,
|
1066
1066
|
embeds: options.embeds !== undefined
|
@@ -1088,7 +1088,7 @@ class Client extends node_events_1.default {
|
|
1088
1088
|
/** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance */
|
1089
1089
|
editStageInstance(channelId, options, reason) {
|
1090
1090
|
return this.rest
|
1091
|
-
.request(rest_1.
|
1091
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.stageInstance(channelId), {
|
1092
1092
|
json: {
|
1093
1093
|
topic: options.topic,
|
1094
1094
|
privacy_level: options.privacyLevel,
|
@@ -1100,7 +1100,7 @@ class Client extends node_events_1.default {
|
|
1100
1100
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message */
|
1101
1101
|
editInteractionFollowupMessage(applicationId, interactionToken, messageId, options) {
|
1102
1102
|
return this.rest
|
1103
|
-
.request(rest_1.
|
1103
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookMessage(applicationId, interactionToken, messageId), {
|
1104
1104
|
json: {
|
1105
1105
|
content: options.content,
|
1106
1106
|
embeds: options.embeds !== undefined
|
@@ -1131,7 +1131,7 @@ class Client extends node_events_1.default {
|
|
1131
1131
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response */
|
1132
1132
|
editInteractionResponse(applicationId, interactionToken, options) {
|
1133
1133
|
return this.rest
|
1134
|
-
.request(rest_1.
|
1134
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(applicationId, interactionToken), {
|
1135
1135
|
json: {
|
1136
1136
|
content: options.content,
|
1137
1137
|
embeds: options.embeds !== undefined
|
@@ -1161,7 +1161,7 @@ class Client extends node_events_1.default {
|
|
1161
1161
|
}
|
1162
1162
|
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state */
|
1163
1163
|
editUserVoiceState(guildId, userId, options) {
|
1164
|
-
this.rest.request(rest_1.
|
1164
|
+
this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.guildVoiceState(guildId, userId), {
|
1165
1165
|
json: {
|
1166
1166
|
channel_id: options.channelId,
|
1167
1167
|
suppress: options.suppress,
|
@@ -1172,7 +1172,7 @@ class Client extends node_events_1.default {
|
|
1172
1172
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook */
|
1173
1173
|
editWebhook(webhookId, options, reason) {
|
1174
1174
|
return this.rest
|
1175
|
-
.request(rest_1.
|
1175
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(webhookId), {
|
1176
1176
|
json: {
|
1177
1177
|
name: options.name,
|
1178
1178
|
avatar: options.avatar,
|
@@ -1185,7 +1185,7 @@ class Client extends node_events_1.default {
|
|
1185
1185
|
/** https://discord.com/developers/docs/resources/webhook#edit-webhook-message */
|
1186
1186
|
editWebhookMessage(webhookId, webhookToken, messageId, options) {
|
1187
1187
|
return this.rest
|
1188
|
-
.request(rest_1.
|
1188
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhookMessage(webhookId, webhookToken, messageId), {
|
1189
1189
|
json: {
|
1190
1190
|
content: options.content,
|
1191
1191
|
embeds: options.embeds !== undefined
|
@@ -1216,7 +1216,7 @@ class Client extends node_events_1.default {
|
|
1216
1216
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
1217
1217
|
editWebhookWithToken(webhookId, webhookToken, options, reason) {
|
1218
1218
|
return this.rest
|
1219
|
-
.request(rest_1.
|
1219
|
+
.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.webhook(webhookId, webhookToken), {
|
1220
1220
|
json: {
|
1221
1221
|
name: options.name,
|
1222
1222
|
avatar: options.avatar,
|
@@ -1229,7 +1229,7 @@ class Client extends node_events_1.default {
|
|
1229
1229
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
1230
1230
|
executeWebhook(webhookId, webhookToken, options) {
|
1231
1231
|
return this.rest
|
1232
|
-
.request(rest_1.
|
1232
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhook(webhookId, webhookToken), {
|
1233
1233
|
json: {
|
1234
1234
|
content: options.content,
|
1235
1235
|
username: options.username,
|
@@ -1269,7 +1269,7 @@ class Client extends node_events_1.default {
|
|
1269
1269
|
*/
|
1270
1270
|
executeWebhookPlatform(webhookId, webhookToken, platform, options) {
|
1271
1271
|
return this.rest
|
1272
|
-
.request(rest_1.
|
1272
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.webhookPlatform(webhookId, webhookToken, platform), {
|
1273
1273
|
query: {
|
1274
1274
|
thread_id: options.threadId,
|
1275
1275
|
wait: options.wait,
|
@@ -1281,7 +1281,7 @@ class Client extends node_events_1.default {
|
|
1281
1281
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
1282
1282
|
followChannel(channelId, options) {
|
1283
1283
|
return this.rest
|
1284
|
-
.request(rest_1.
|
1284
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelFollowers(channelId), {
|
1285
1285
|
json: {
|
1286
1286
|
webhook_channel_id: options.webhookChannelId,
|
1287
1287
|
},
|
@@ -1291,13 +1291,13 @@ class Client extends node_events_1.default {
|
|
1291
1291
|
/** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
|
1292
1292
|
getActiveGuildThreads(guildId) {
|
1293
1293
|
return this.rest
|
1294
|
-
.request(rest_1.
|
1294
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildActiveThreads(guildId))
|
1295
1295
|
.then((response) => this.util.toCamelCase(response));
|
1296
1296
|
}
|
1297
1297
|
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
|
1298
1298
|
getArchivedThreads(channelId, archivedStatus, options) {
|
1299
1299
|
return this.rest
|
1300
|
-
.request(rest_1.
|
1300
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(channelId, archivedStatus, false), {
|
1301
1301
|
query: {
|
1302
1302
|
before: options?.before,
|
1303
1303
|
limit: options?.limit,
|
@@ -1308,7 +1308,7 @@ class Client extends node_events_1.default {
|
|
1308
1308
|
/** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */
|
1309
1309
|
getAuditLog(guildId, options) {
|
1310
1310
|
return this.rest
|
1311
|
-
.request(rest_1.
|
1311
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAuditLog(guildId), {
|
1312
1312
|
query: {
|
1313
1313
|
user_id: options?.userId,
|
1314
1314
|
action_type: options?.actionType,
|
@@ -1322,79 +1322,79 @@ class Client extends node_events_1.default {
|
|
1322
1322
|
/** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
|
1323
1323
|
getAutoModerationRule(guildId, ruleId) {
|
1324
1324
|
return this.rest
|
1325
|
-
.request(rest_1.
|
1325
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRule(guildId, ruleId))
|
1326
1326
|
.then((response) => this.util.toCamelCase(response));
|
1327
1327
|
}
|
1328
1328
|
/** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
|
1329
1329
|
getAutoModerationRules(guildId) {
|
1330
1330
|
return this.rest
|
1331
|
-
.request(rest_1.
|
1331
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRules(guildId))
|
1332
1332
|
.then((response) => response.map((autoModerationRule) => this.util.toCamelCase(autoModerationRule)));
|
1333
1333
|
}
|
1334
1334
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
1335
1335
|
getApplicationCommandPermissions(applicationId, guildId, commandId) {
|
1336
1336
|
return this.rest
|
1337
|
-
.request(rest_1.
|
1338
|
-
.then((response) => this.util.toCamelCase(response));
|
1339
|
-
}
|
1340
|
-
/** https://discord.com/developers/docs/resources/user#get-user-application-role-connection */
|
1341
|
-
getApplicationRoleConnection(applicationId) {
|
1342
|
-
return this.rest
|
1343
|
-
.request(rest_1.RestMethods.Get, rest_1.Endpoints.userApplicationRoleConnection(applicationId))
|
1337
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommandPermissions(applicationId, guildId, commandId))
|
1344
1338
|
.then((response) => this.util.toCamelCase(response));
|
1345
1339
|
}
|
1346
1340
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
|
1347
1341
|
getApplicationRoleConnectionMetadataRecords(applicationId) {
|
1348
1342
|
return this.rest
|
1349
|
-
.request(rest_1.
|
1343
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationId))
|
1350
1344
|
.then((response) => response.map((applicationRoleConnectionMetadata) => this.util.toCamelCase(applicationRoleConnectionMetadata)));
|
1351
1345
|
}
|
1352
1346
|
/** https://discord.com/developers/docs/resources/channel#get-channel */
|
1353
1347
|
getChannel(channelId) {
|
1354
1348
|
return this.rest
|
1355
|
-
.request(rest_1.
|
1349
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channel(channelId))
|
1356
1350
|
.then((response) => this.util.toCamelCase(response));
|
1357
1351
|
}
|
1358
1352
|
/** https://discord.com/developers/docs/resources/guild#get-guild-channels */
|
1359
1353
|
getChannels(guildId) {
|
1360
1354
|
return this.rest
|
1361
|
-
.request(rest_1.
|
1355
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildChannels(guildId))
|
1362
1356
|
.then((response) => response.map((channel) => this.util.toCamelCase(channel)));
|
1363
1357
|
}
|
1364
1358
|
/** https://discord.com/developers/docs/resources/channel#get-channel-invites */
|
1365
1359
|
getChannelInvites(channelId) {
|
1366
1360
|
return this.rest
|
1367
|
-
.request(rest_1.
|
1361
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelInvites(channelId))
|
1368
1362
|
.then((response) => response.map((invite) => this.util.toCamelCase(invite)));
|
1369
1363
|
}
|
1370
1364
|
/** https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */
|
1371
1365
|
getChannelWebhooks(channelId) {
|
1372
1366
|
return this.rest
|
1373
|
-
.request(rest_1.
|
1367
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelWebhooks(channelId))
|
1374
1368
|
.then((response) => response.map((webhook) => this.util.toCamelCase(webhook)));
|
1375
1369
|
}
|
1376
|
-
/** https://discord.com/developers/docs/resources/user#get-user-connections */
|
1377
|
-
getConnections() {
|
1378
|
-
return this.rest
|
1379
|
-
.request(rest_1.RestMethods.Get, rest_1.Endpoints.userConnections())
|
1380
|
-
.then((response) => response.map((connection) => this.util.toCamelCase(connection)));
|
1381
|
-
}
|
1382
1370
|
/** https://discord.com/developers/docs/resources/application#get-current-application */
|
1383
1371
|
getCurrentApplication() {
|
1384
1372
|
return this.rest
|
1385
|
-
.request(rest_1.
|
1373
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCurrentUser())
|
1374
|
+
.then((response) => this.util.toCamelCase(response));
|
1375
|
+
}
|
1376
|
+
/** https://discord.com/developers/docs/resources/user#get-current-user-application-role-connection */
|
1377
|
+
getCurrentApplicationRoleConnection(applicationId) {
|
1378
|
+
return this.rest
|
1379
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userApplicationRoleConnection(applicationId))
|
1386
1380
|
.then((response) => this.util.toCamelCase(response));
|
1387
1381
|
}
|
1388
1382
|
/** https://discord.com/developers/docs/resources/user#get-current-user-guild-member */
|
1389
1383
|
getCurrentGuildMember(guildId) {
|
1390
1384
|
return this.rest
|
1391
|
-
.request(rest_1.
|
1385
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(guildId))
|
1392
1386
|
.then((response) => this.util.toCamelCase(response));
|
1393
1387
|
}
|
1388
|
+
/** https://discord.com/developers/docs/resources/user#get-current-user-connections */
|
1389
|
+
getCurrentUserConnections() {
|
1390
|
+
return this.rest
|
1391
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userConnections())
|
1392
|
+
.then((response) => response.map((connection) => this.util.toCamelCase(connection)));
|
1393
|
+
}
|
1394
1394
|
/** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
|
1395
1395
|
getEntitlements(applicationId, options) {
|
1396
1396
|
return this.rest
|
1397
|
-
.request(rest_1.
|
1397
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationId), {
|
1398
1398
|
query: {
|
1399
1399
|
user_id: options?.userId,
|
1400
1400
|
sku_ids: options?.skuIds,
|
@@ -1409,24 +1409,24 @@ class Client extends node_events_1.default {
|
|
1409
1409
|
}
|
1410
1410
|
/** https://discord.com/developers/docs/topics/gateway#get-gateway */
|
1411
1411
|
getGateway() {
|
1412
|
-
return this.rest.request(rest_1.
|
1412
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.gateway());
|
1413
1413
|
}
|
1414
1414
|
/** https://discord.com/developers/docs/topics/gateway#get-gateway-bot */
|
1415
1415
|
getGatewayBot() {
|
1416
1416
|
return this.rest
|
1417
|
-
.request(rest_1.
|
1417
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.gatewayBot())
|
1418
1418
|
.then((response) => this.util.toCamelCase(response));
|
1419
1419
|
}
|
1420
1420
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
|
1421
1421
|
getGlobalApplicationCommand(applicationId, commandId) {
|
1422
1422
|
return this.rest
|
1423
|
-
.request(rest_1.
|
1423
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommand(applicationId, commandId))
|
1424
1424
|
.then((response) => this.util.toCamelCase(response));
|
1425
1425
|
}
|
1426
1426
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
|
1427
1427
|
getGlobalApplicationCommands(applicationId, options) {
|
1428
1428
|
return this.rest
|
1429
|
-
.request(rest_1.
|
1429
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommands(applicationId), {
|
1430
1430
|
query: {
|
1431
1431
|
with_localizations: options.withLocalizations,
|
1432
1432
|
},
|
@@ -1436,7 +1436,7 @@ class Client extends node_events_1.default {
|
|
1436
1436
|
/** https://discord.com/developers/docs/resources/guild#get-guild */
|
1437
1437
|
getGuild(guildId, options) {
|
1438
1438
|
return this.rest
|
1439
|
-
.request(rest_1.
|
1439
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guild(guildId), {
|
1440
1440
|
query: {
|
1441
1441
|
with_counts: options?.withCounts,
|
1442
1442
|
},
|
@@ -1446,7 +1446,7 @@ class Client extends node_events_1.default {
|
|
1446
1446
|
/** https://discord.com/developers/docs/resources/user#get-current-user-guilds */
|
1447
1447
|
getGuilds(options) {
|
1448
1448
|
return this.rest
|
1449
|
-
.request(rest_1.
|
1449
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userGuilds(), {
|
1450
1450
|
query: {
|
1451
1451
|
before: options?.before,
|
1452
1452
|
after: options?.after,
|
@@ -1459,13 +1459,13 @@ class Client extends node_events_1.default {
|
|
1459
1459
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
|
1460
1460
|
getGuildApplicationCommand(applicationId, guildId, commandId) {
|
1461
1461
|
return this.rest
|
1462
|
-
.request(rest_1.
|
1462
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommand(applicationId, guildId, commandId))
|
1463
1463
|
.then((response) => this.util.toCamelCase(response));
|
1464
1464
|
}
|
1465
1465
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
|
1466
1466
|
getGuildApplicationCommands(applicationId, guildId, options) {
|
1467
1467
|
return this.rest
|
1468
|
-
.request(rest_1.
|
1468
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommands(applicationId, guildId), {
|
1469
1469
|
query: {
|
1470
1470
|
with_localizations: options?.withLocalizations,
|
1471
1471
|
},
|
@@ -1475,19 +1475,19 @@ class Client extends node_events_1.default {
|
|
1475
1475
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
|
1476
1476
|
getGuildApplicationCommandPermissions(applicationId, guildId) {
|
1477
1477
|
return this.rest
|
1478
|
-
.request(rest_1.
|
1478
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildApplicationCommandsPermissions(applicationId, guildId))
|
1479
1479
|
.then((response) => this.util.toCamelCase(response));
|
1480
1480
|
}
|
1481
1481
|
/** https://discord.com/developers/docs/resources/guild#get-guild-ban */
|
1482
1482
|
getGuildBan(guildId, userId) {
|
1483
1483
|
return this.rest
|
1484
|
-
.request(rest_1.
|
1484
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBan(guildId, userId))
|
1485
1485
|
.then((response) => this.util.toCamelCase(response));
|
1486
1486
|
}
|
1487
1487
|
/** https://discord.com/developers/docs/resources/guild#get-guild-bans */
|
1488
1488
|
getGuildBans(guildId, options) {
|
1489
1489
|
return this.rest
|
1490
|
-
.request(rest_1.
|
1490
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBans(guildId), {
|
1491
1491
|
query: {
|
1492
1492
|
limit: options?.limit,
|
1493
1493
|
before: options?.before,
|
@@ -1499,55 +1499,55 @@ class Client extends node_events_1.default {
|
|
1499
1499
|
/** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
|
1500
1500
|
getGuildEmoji(guildId, emojiId) {
|
1501
1501
|
return this.rest
|
1502
|
-
.request(rest_1.
|
1502
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmoji(guildId, emojiId))
|
1503
1503
|
.then((response) => this.util.toCamelCase(response));
|
1504
1504
|
}
|
1505
1505
|
/** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
|
1506
1506
|
getGuildEmojis(guildId) {
|
1507
1507
|
return this.rest
|
1508
|
-
.request(rest_1.
|
1508
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmojis(guildId))
|
1509
1509
|
.then((response) => response.map((emoji) => this.util.toCamelCase(emoji)));
|
1510
1510
|
}
|
1511
1511
|
/** https://discord.com/developers/docs/resources/guild#get-guild-integrations */
|
1512
1512
|
getGuildIntegrations(guildId) {
|
1513
1513
|
return this.rest
|
1514
|
-
.request(rest_1.
|
1514
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildIntegrations(guildId))
|
1515
1515
|
.then((response) => response.map((integration) => this.util.toCamelCase(integration)));
|
1516
1516
|
}
|
1517
1517
|
/** https://discord.com/developers/docs/resources/guild#get-guild-invites */
|
1518
1518
|
getGuildInvites(guildId) {
|
1519
1519
|
return this.rest
|
1520
|
-
.request(rest_1.
|
1520
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildInvites(guildId))
|
1521
1521
|
.then((response) => response.map((invite) => this.util.toCamelCase(invite)));
|
1522
1522
|
}
|
1523
1523
|
/** https://discord.com/developers/docs/resources/guild#get-guild-member */
|
1524
1524
|
getGuildMember(guildId, userId) {
|
1525
1525
|
return this.rest
|
1526
|
-
.request(rest_1.
|
1526
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(guildId, userId))
|
1527
1527
|
.then((response) => this.util.toCamelCase(response));
|
1528
1528
|
}
|
1529
1529
|
/** https://discord.com/developers/docs/resources/guild#list-guild-members */
|
1530
1530
|
getGuildMembers(guildId) {
|
1531
1531
|
return this.rest
|
1532
|
-
.request(rest_1.
|
1532
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembers(guildId))
|
1533
1533
|
.then((response) => response.map((guildMember) => this.util.toCamelCase(guildMember)));
|
1534
1534
|
}
|
1535
1535
|
/** https://discord.com/developers/docs/resources/guild#get-guild-onboarding */
|
1536
1536
|
getGuildOnboarding(guildId) {
|
1537
1537
|
return this.rest
|
1538
|
-
.request(rest_1.
|
1538
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildOnboarding(guildId))
|
1539
1539
|
.then((response) => this.util.toCamelCase(response));
|
1540
1540
|
}
|
1541
1541
|
/** https://discord.com/developers/docs/resources/guild#get-guild-preview */
|
1542
1542
|
getGuildPreview(guildId) {
|
1543
1543
|
return this.rest
|
1544
|
-
.request(rest_1.
|
1544
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPreview(guildId))
|
1545
1545
|
.then((response) => this.util.toCamelCase(response));
|
1546
1546
|
}
|
1547
1547
|
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
|
1548
1548
|
getGuildPruneCount(guildId, options) {
|
1549
1549
|
return this.rest
|
1550
|
-
.request(rest_1.
|
1550
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPrune(guildId), {
|
1551
1551
|
query: {
|
1552
1552
|
days: options.days,
|
1553
1553
|
include_roles: options.includeRoles,
|
@@ -1558,13 +1558,13 @@ class Client extends node_events_1.default {
|
|
1558
1558
|
/** https://discord.com/developers/docs/resources/guild#get-guild-roles */
|
1559
1559
|
getGuildRoles(guildId) {
|
1560
1560
|
return this.rest
|
1561
|
-
.request(rest_1.
|
1561
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRoles(guildId))
|
1562
1562
|
.then((response) => response.map((role) => this.util.toCamelCase(role)));
|
1563
1563
|
}
|
1564
1564
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild */
|
1565
1565
|
getGuildScheduledEvents(guildId, options) {
|
1566
1566
|
return this.rest
|
1567
|
-
.request(rest_1.
|
1567
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvents(guildId), {
|
1568
1568
|
query: {
|
1569
1569
|
with_user_count: options?.withUserCount,
|
1570
1570
|
},
|
@@ -1574,7 +1574,7 @@ class Client extends node_events_1.default {
|
|
1574
1574
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users */
|
1575
1575
|
getGuildScheduledEventUsers(guildId, guildScheduledEventId, options) {
|
1576
1576
|
return this.rest
|
1577
|
-
.request(rest_1.
|
1577
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvent(guildId, guildScheduledEventId), {
|
1578
1578
|
query: {
|
1579
1579
|
limit: options?.limit,
|
1580
1580
|
with_member: options?.withMember,
|
@@ -1587,52 +1587,52 @@ class Client extends node_events_1.default {
|
|
1587
1587
|
/** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
|
1588
1588
|
getGuildSticker(guildId, stickerId) {
|
1589
1589
|
return this.rest
|
1590
|
-
.request(rest_1.
|
1590
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSticker(guildId, stickerId))
|
1591
1591
|
.then((response) => this.util.toCamelCase(response));
|
1592
1592
|
}
|
1593
1593
|
/** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
|
1594
1594
|
getGuildStickers(guildId) {
|
1595
1595
|
return this.rest
|
1596
|
-
.request(rest_1.
|
1596
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildStickers(guildId))
|
1597
1597
|
.then((response) => response.map((sticker) => this.util.toCamelCase(sticker)));
|
1598
1598
|
}
|
1599
1599
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
1600
1600
|
getGuildTemplate(guildId, code) {
|
1601
1601
|
return this.rest
|
1602
|
-
.request(rest_1.
|
1602
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplate(guildId, code))
|
1603
1603
|
.then((response) => this.util.toCamelCase(response));
|
1604
1604
|
}
|
1605
1605
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-templates */
|
1606
1606
|
getGuildTemplates(guildId) {
|
1607
1607
|
return this.rest
|
1608
|
-
.request(rest_1.
|
1608
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplates(guildId))
|
1609
1609
|
.then((response) => response.map((guildTemplate) => this.util.toCamelCase(guildTemplate)));
|
1610
1610
|
}
|
1611
1611
|
/** https://discord.com/developers/docs/resources/guild#get-guild-vanity-url */
|
1612
1612
|
getGuildVanityUrl(guildId) {
|
1613
|
-
return this.rest.request(rest_1.
|
1613
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVanityUrl(guildId));
|
1614
1614
|
}
|
1615
1615
|
/** https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */
|
1616
1616
|
getGuildVoiceRegions(guildId) {
|
1617
1617
|
return this.rest
|
1618
|
-
.request(rest_1.
|
1618
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceRegions(guildId))
|
1619
1619
|
.then((response) => response.map((VoiceRegion) => this.util.toCamelCase(VoiceRegion)));
|
1620
1620
|
}
|
1621
1621
|
/** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
|
1622
1622
|
getGuildWelcomeScreen(guildId) {
|
1623
1623
|
return this.rest
|
1624
|
-
.request(rest_1.
|
1624
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWelcomeScreen(guildId))
|
1625
1625
|
.then((response) => this.util.toCamelCase(response));
|
1626
1626
|
}
|
1627
1627
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget */
|
1628
1628
|
getGuildWidget(guildId) {
|
1629
1629
|
return this.rest
|
1630
|
-
.request(rest_1.
|
1630
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetJSON(guildId))
|
1631
1631
|
.then((response) => this.util.toCamelCase(response));
|
1632
1632
|
}
|
1633
1633
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
|
1634
1634
|
getGuildWidgetImage(guildId, options) {
|
1635
|
-
return this.rest.request(rest_1.
|
1635
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetImage(guildId), {
|
1636
1636
|
query: {
|
1637
1637
|
style: options?.style,
|
1638
1638
|
},
|
@@ -1641,13 +1641,13 @@ class Client extends node_events_1.default {
|
|
1641
1641
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-settings */
|
1642
1642
|
getGuildWidgetSettings(guildId) {
|
1643
1643
|
return this.rest
|
1644
|
-
.request(rest_1.
|
1644
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetSettings(guildId))
|
1645
1645
|
.then((response) => this.util.toCamelCase(response));
|
1646
1646
|
}
|
1647
1647
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message */
|
1648
1648
|
getInteractionFollowupMessage(applicationId, interactionToken, messageId, options) {
|
1649
1649
|
return this.rest
|
1650
|
-
.request(rest_1.
|
1650
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(applicationId, interactionToken, messageId), {
|
1651
1651
|
query: {
|
1652
1652
|
thread_id: options?.threadId,
|
1653
1653
|
},
|
@@ -1657,7 +1657,7 @@ class Client extends node_events_1.default {
|
|
1657
1657
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response */
|
1658
1658
|
getInteractionResponse(applicationId, interactionToken, options) {
|
1659
1659
|
return this.rest
|
1660
|
-
.request(rest_1.
|
1660
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(applicationId, interactionToken), {
|
1661
1661
|
query: {
|
1662
1662
|
thread_id: options?.threadId,
|
1663
1663
|
},
|
@@ -1667,7 +1667,7 @@ class Client extends node_events_1.default {
|
|
1667
1667
|
/** https://discord.com/developers/docs/resources/invite#get-invite */
|
1668
1668
|
getInvite(code, options) {
|
1669
1669
|
return this.rest
|
1670
|
-
.request(rest_1.
|
1670
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.invite(code), {
|
1671
1671
|
query: {
|
1672
1672
|
with_counts: options?.withCounts,
|
1673
1673
|
with_expiration: options?.withExpiration,
|
@@ -1679,7 +1679,7 @@ class Client extends node_events_1.default {
|
|
1679
1679
|
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
1680
1680
|
getJoinedPrivateArchivedThreads(channelId, options) {
|
1681
1681
|
return this.rest
|
1682
|
-
.request(rest_1.
|
1682
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(channelId, "private", true), {
|
1683
1683
|
query: {
|
1684
1684
|
before: options?.before,
|
1685
1685
|
limit: options?.limit,
|
@@ -1690,13 +1690,13 @@ class Client extends node_events_1.default {
|
|
1690
1690
|
/** https://discord.com/developers/docs/resources/channel#get-channel-message */
|
1691
1691
|
getMessage(channelId, messageId) {
|
1692
1692
|
return this.rest
|
1693
|
-
.request(rest_1.
|
1693
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelId, messageId))
|
1694
1694
|
.then((response) => this.util.toCamelCase(response));
|
1695
1695
|
}
|
1696
1696
|
/** https://discord.com/developers/docs/resources/channel#get-reactions */
|
1697
1697
|
getMessageReactions(channelId, messageId, emoji, options) {
|
1698
1698
|
return this.rest
|
1699
|
-
.request(rest_1.
|
1699
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessageAllReactions(channelId, messageId, emoji), {
|
1700
1700
|
query: {
|
1701
1701
|
after: options?.after,
|
1702
1702
|
limit: options?.limit,
|
@@ -1707,7 +1707,7 @@ class Client extends node_events_1.default {
|
|
1707
1707
|
/** https://discord.com/developers/docs/resources/channel#get-channel-messages */
|
1708
1708
|
getMessages(channelId, options) {
|
1709
1709
|
return this.rest
|
1710
|
-
.request(rest_1.
|
1710
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessages(channelId), {
|
1711
1711
|
query: {
|
1712
1712
|
around: options.around,
|
1713
1713
|
before: options.before,
|
@@ -1720,43 +1720,43 @@ class Client extends node_events_1.default {
|
|
1720
1720
|
/** https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information */
|
1721
1721
|
getOAuth2Application() {
|
1722
1722
|
return this.rest
|
1723
|
-
.request(rest_1.
|
1723
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.oauth2CurrentApplication())
|
1724
1724
|
.then((response) => this.util.toCamelCase(response));
|
1725
1725
|
}
|
1726
1726
|
/** https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information */
|
1727
1727
|
getOAuth2Authorization() {
|
1728
1728
|
return this.rest
|
1729
|
-
.request(rest_1.
|
1729
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.oauth2Authorization())
|
1730
1730
|
.then((response) => this.util.toCamelCase(response));
|
1731
1731
|
}
|
1732
1732
|
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
1733
1733
|
getPinnedMessages(channelId) {
|
1734
1734
|
return this.rest
|
1735
|
-
.request(rest_1.
|
1735
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelId))
|
1736
1736
|
.then((response) => response.map((message) => this.util.toCamelCase(message)));
|
1737
1737
|
}
|
1738
1738
|
/** https://discord.com/developers/docs/monetization/skus#list-skus */
|
1739
1739
|
getSkus(applicationId) {
|
1740
1740
|
return this.rest
|
1741
|
-
.request(rest_1.
|
1741
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationSkus(applicationId))
|
1742
1742
|
.then((response) => response.map((sku) => this.util.toCamelCase(sku)));
|
1743
1743
|
}
|
1744
1744
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
1745
1745
|
getStageInstance(channelId) {
|
1746
1746
|
return this.rest
|
1747
|
-
.request(rest_1.
|
1747
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stageInstance(channelId))
|
1748
1748
|
.then((response) => this.util.toCamelCase(response));
|
1749
1749
|
}
|
1750
1750
|
/** https://discord.com/developers/docs/resources/sticker#list-sticker-packs */
|
1751
1751
|
getStickerPacks() {
|
1752
1752
|
return this.rest
|
1753
|
-
.request(rest_1.
|
1753
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stickerPacks())
|
1754
1754
|
.then((response) => this.util.toCamelCase(response));
|
1755
1755
|
}
|
1756
1756
|
/** https://discord.com/developers/docs/resources/channel#get-thread-member */
|
1757
1757
|
getThreadMember(channelId, userId, options) {
|
1758
1758
|
return this.rest
|
1759
|
-
.request(rest_1.
|
1759
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(channelId, userId), {
|
1760
1760
|
query: {
|
1761
1761
|
with_member: options?.withMember,
|
1762
1762
|
},
|
@@ -1766,7 +1766,7 @@ class Client extends node_events_1.default {
|
|
1766
1766
|
/** https://discord.com/developers/docs/resources/channel#list-thread-members */
|
1767
1767
|
getThreadMembers(channelId, options) {
|
1768
1768
|
return this.rest
|
1769
|
-
.request(rest_1.
|
1769
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(channelId), {
|
1770
1770
|
query: {
|
1771
1771
|
with_member: options?.withMember,
|
1772
1772
|
after: options?.after,
|
@@ -1778,19 +1778,19 @@ class Client extends node_events_1.default {
|
|
1778
1778
|
/** https://discord.com/developers/docs/resources/user#get-user */
|
1779
1779
|
getUser(userId) {
|
1780
1780
|
return this.rest
|
1781
|
-
.request(rest_1.
|
1781
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.user(userId))
|
1782
1782
|
.then((response) => this.util.toCamelCase(response));
|
1783
1783
|
}
|
1784
1784
|
/** https://discord.com/developers/docs/resources/voice#list-voice-regions */
|
1785
1785
|
getVoiceRegions() {
|
1786
1786
|
return this.rest
|
1787
|
-
.request(rest_1.
|
1787
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.voiceRegions())
|
1788
1788
|
.then((response) => response.map((voiceRegion) => this.util.toCamelCase(voiceRegion)));
|
1789
1789
|
}
|
1790
1790
|
/** https://discord.com/developers/docs/resources/webhook#get-webhook-message */
|
1791
1791
|
getWebhookMessage(webhookId, webhookToken, messageId, options) {
|
1792
1792
|
return this.rest
|
1793
|
-
.request(rest_1.
|
1793
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(webhookId, webhookToken, messageId), {
|
1794
1794
|
query: {
|
1795
1795
|
thread_id: options?.threadId,
|
1796
1796
|
},
|
@@ -1800,12 +1800,12 @@ class Client extends node_events_1.default {
|
|
1800
1800
|
/** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
|
1801
1801
|
getWebhooks(guildId) {
|
1802
1802
|
return this.rest
|
1803
|
-
.request(rest_1.
|
1803
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(guildId))
|
1804
1804
|
.then((response) => response.map((webhook) => this.util.toCamelCase(webhook)));
|
1805
1805
|
}
|
1806
1806
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
1807
1807
|
joinThread(channelId) {
|
1808
|
-
this.rest.request(rest_1.
|
1808
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelId, "@me"));
|
1809
1809
|
}
|
1810
1810
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
1811
1811
|
joinVoiceChannel(guildId, channelId, options) {
|
@@ -1821,11 +1821,11 @@ class Client extends node_events_1.default {
|
|
1821
1821
|
}
|
1822
1822
|
/** https://discord.com/developers/docs/resources/user#leave-guild */
|
1823
1823
|
leaveGuild(guildId) {
|
1824
|
-
this.rest.request(rest_1.
|
1824
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(guildId));
|
1825
1825
|
}
|
1826
1826
|
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
1827
1827
|
leaveThread(channelId) {
|
1828
|
-
this.rest.request(rest_1.
|
1828
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelId, "@me"));
|
1829
1829
|
}
|
1830
1830
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
1831
1831
|
leaveVoiceChannel(guildId) {
|
@@ -1841,40 +1841,40 @@ class Client extends node_events_1.default {
|
|
1841
1841
|
}
|
1842
1842
|
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
1843
1843
|
pinMessage(channelId, messageId, reason) {
|
1844
|
-
this.rest.request(rest_1.
|
1844
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(channelId, messageId), {
|
1845
1845
|
reason,
|
1846
1846
|
});
|
1847
1847
|
}
|
1848
1848
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
|
1849
1849
|
removeBan(guildId, userId, reason) {
|
1850
|
-
this.rest.request(rest_1.
|
1850
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildBan(guildId, userId), {
|
1851
1851
|
reason,
|
1852
1852
|
});
|
1853
1853
|
}
|
1854
1854
|
/** https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient */
|
1855
1855
|
removeGroupRecipient(channelId, userId) {
|
1856
|
-
this.rest.request(rest_1.
|
1856
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelRecipient(channelId, userId));
|
1857
1857
|
}
|
1858
1858
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member */
|
1859
1859
|
removeGuildMember(guildId, userId, reason) {
|
1860
|
-
this.rest.request(rest_1.
|
1860
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMember(guildId, userId), {
|
1861
1861
|
reason,
|
1862
1862
|
});
|
1863
1863
|
}
|
1864
1864
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
1865
1865
|
removeGuildMemberRole(guildId, userId, roleId, reason) {
|
1866
|
-
this.rest.request(rest_1.
|
1866
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMemberRole(guildId, userId, roleId), {
|
1867
1867
|
reason,
|
1868
1868
|
});
|
1869
1869
|
}
|
1870
1870
|
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
1871
1871
|
removeThreadMember(channelId, userId) {
|
1872
|
-
this.rest.request(rest_1.
|
1872
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelId, userId));
|
1873
1873
|
}
|
1874
1874
|
/** https://discord.com/developers/docs/resources/guild#search-guild-members */
|
1875
1875
|
searchGuildMembers(guildId, options) {
|
1876
1876
|
return this.rest
|
1877
|
-
.request(rest_1.
|
1877
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembersSearch(guildId), {
|
1878
1878
|
query: {
|
1879
1879
|
query: options.query,
|
1880
1880
|
limit: options.limit,
|
@@ -1890,23 +1890,23 @@ class Client extends node_events_1.default {
|
|
1890
1890
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
1891
1891
|
syncGuildTemplate(guildId, code) {
|
1892
1892
|
return this.rest
|
1893
|
-
.request(rest_1.
|
1893
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildTemplate(guildId, code))
|
1894
1894
|
.then((response) => this.util.toCamelCase(response));
|
1895
1895
|
}
|
1896
1896
|
/** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
|
1897
1897
|
triggerTypingIndicator(channelId) {
|
1898
|
-
this.rest.request(rest_1.
|
1898
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(channelId));
|
1899
1899
|
}
|
1900
1900
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
1901
1901
|
updateApplicationRoleConnectionMetadataRecords(applicationId) {
|
1902
1902
|
return this.rest
|
1903
|
-
.request(rest_1.
|
1903
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationId))
|
1904
1904
|
.then((response) => response.map((applicationRoleConnectionMetadata) => this.util.toCamelCase(applicationRoleConnectionMetadata)));
|
1905
1905
|
}
|
1906
|
-
/** https://discord.com/developers/docs/resources/user#update-user-application-role-connection */
|
1906
|
+
/** https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection */
|
1907
1907
|
updateCurrentApplicationRoleConnection(options) {
|
1908
1908
|
return this.rest
|
1909
|
-
.request(rest_1.
|
1909
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.userApplicationRoleConnection(this.application.id), {
|
1910
1910
|
json: {
|
1911
1911
|
platform_name: options.platformName,
|
1912
1912
|
platform_username: options.platformUsername,
|
@@ -1917,7 +1917,7 @@ class Client extends node_events_1.default {
|
|
1917
1917
|
}
|
1918
1918
|
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
1919
1919
|
unpinMessage(channelId, messageId, reason) {
|
1920
|
-
this.rest.request(rest_1.
|
1920
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPin(channelId, messageId), {
|
1921
1921
|
reason,
|
1922
1922
|
});
|
1923
1923
|
}
|