disgroove 2.0.0 → 2.1.0-dev.c430b6f
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 +10 -1
- package/dist/lib/Client.js +193 -179
- package/dist/lib/constants.d.ts +17 -5
- package/dist/lib/constants.js +221 -209
- package/dist/lib/gateway/Shard.js +6 -1
- package/dist/lib/gateway/ShardManager.js +0 -1
- package/dist/lib/gateway/index.js +0 -1
- package/dist/lib/index.js +0 -1
- package/dist/lib/rest/CDN.js +0 -1
- package/dist/lib/rest/Endpoints.d.ts +4 -2
- package/dist/lib/rest/Endpoints.js +8 -5
- package/dist/lib/rest/RequestManager.d.ts +2 -3
- package/dist/lib/rest/RequestManager.js +17 -18
- package/dist/lib/rest/index.js +0 -1
- package/dist/lib/types/application-command.js +0 -1
- package/dist/lib/types/application-role-connection-metadata.js +0 -1
- package/dist/lib/types/application.js +0 -1
- package/dist/lib/types/audit-log.js +0 -1
- package/dist/lib/types/auto-moderation.js +0 -1
- package/dist/lib/types/channel.d.ts +4 -0
- package/dist/lib/types/channel.js +0 -1
- package/dist/lib/types/emoji.js +0 -1
- package/dist/lib/types/entitlements.js +0 -1
- package/dist/lib/types/gateway-events.d.ts +28 -0
- package/dist/lib/types/gateway-events.js +0 -1
- package/dist/lib/types/guild-scheduled-event.js +0 -1
- package/dist/lib/types/guild-template.js +0 -1
- package/dist/lib/types/guild.js +0 -1
- package/dist/lib/types/index.js +0 -1
- package/dist/lib/types/interaction.d.ts +3 -0
- package/dist/lib/types/interaction.js +0 -1
- package/dist/lib/types/invite.js +0 -1
- package/dist/lib/types/message-components.js +0 -1
- package/dist/lib/types/poll.d.ts +52 -0
- package/dist/lib/types/poll.js +2 -0
- package/dist/lib/types/role.js +0 -1
- package/dist/lib/types/sku.js +0 -1
- package/dist/lib/types/stage-instance.js +0 -1
- package/dist/lib/types/sticker.js +0 -1
- package/dist/lib/types/team.js +0 -1
- package/dist/lib/types/user.js +0 -1
- package/dist/lib/types/voice.js +0 -1
- package/dist/lib/types/webhook.d.ts +3 -0
- package/dist/lib/types/webhook.js +0 -1
- package/dist/lib/utils/Util.js +0 -1
- package/dist/lib/utils/errors.d.ts +1 -1
- package/dist/lib/utils/errors.js +4 -5
- package/dist/lib/utils/index.js +0 -1
- package/dist/package.json +4 -1
- package/package.json +4 -1
- package/dist/lib/Client.js.map +0 -1
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/gateway/Shard.js.map +0 -1
- package/dist/lib/gateway/ShardManager.js.map +0 -1
- package/dist/lib/gateway/ShardsManager.d.ts +0 -6
- package/dist/lib/gateway/ShardsManager.js +0 -14
- package/dist/lib/gateway/ShardsManager.js.map +0 -1
- package/dist/lib/gateway/index.js.map +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/rest/CDN.js.map +0 -1
- package/dist/lib/rest/Endpoints.js.map +0 -1
- package/dist/lib/rest/REST.d.ts +0 -17
- package/dist/lib/rest/REST.js +0 -35
- package/dist/lib/rest/REST.js.map +0 -1
- package/dist/lib/rest/RequestManager.js.map +0 -1
- package/dist/lib/rest/RequestsManager.d.ts +0 -22
- package/dist/lib/rest/RequestsManager.js +0 -123
- package/dist/lib/rest/RequestsManager.js.map +0 -1
- package/dist/lib/rest/index.js.map +0 -1
- package/dist/lib/structures/Application.d.ts +0 -174
- package/dist/lib/structures/Application.js +0 -328
- package/dist/lib/structures/Application.js.map +0 -1
- package/dist/lib/structures/ApplicationCommand.d.ts +0 -45
- package/dist/lib/structures/ApplicationCommand.js +0 -127
- package/dist/lib/structures/ApplicationCommand.js.map +0 -1
- package/dist/lib/structures/AuditLog.d.ts +0 -19
- package/dist/lib/structures/AuditLog.js +0 -101
- package/dist/lib/structures/AuditLog.js.map +0 -1
- package/dist/lib/structures/AutoModerationRule.d.ts +0 -34
- package/dist/lib/structures/AutoModerationRule.js +0 -96
- package/dist/lib/structures/AutoModerationRule.js.map +0 -1
- package/dist/lib/structures/Base.d.ts +0 -10
- package/dist/lib/structures/Base.js +0 -23
- package/dist/lib/structures/Base.js.map +0 -1
- package/dist/lib/structures/Channel.d.ts +0 -254
- package/dist/lib/structures/Channel.js +0 -592
- package/dist/lib/structures/Channel.js.map +0 -1
- package/dist/lib/structures/ClientApplication.d.ts +0 -150
- package/dist/lib/structures/ClientApplication.js +0 -241
- package/dist/lib/structures/ClientApplication.js.map +0 -1
- package/dist/lib/structures/Emoji.d.ts +0 -26
- package/dist/lib/structures/Emoji.js +0 -75
- package/dist/lib/structures/Emoji.js.map +0 -1
- package/dist/lib/structures/Entitlement.d.ts +0 -24
- package/dist/lib/structures/Entitlement.js +0 -68
- package/dist/lib/structures/Entitlement.js.map +0 -1
- package/dist/lib/structures/Guild.d.ts +0 -474
- package/dist/lib/structures/Guild.js +0 -1141
- package/dist/lib/structures/Guild.js.map +0 -1
- package/dist/lib/structures/GuildMember.d.ts +0 -49
- package/dist/lib/structures/GuildMember.js +0 -146
- package/dist/lib/structures/GuildMember.js.map +0 -1
- package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -49
- package/dist/lib/structures/GuildScheduledEvent.js +0 -118
- package/dist/lib/structures/GuildScheduledEvent.js.map +0 -1
- package/dist/lib/structures/GuildTemplate.d.ts +0 -30
- package/dist/lib/structures/GuildTemplate.js +0 -72
- package/dist/lib/structures/GuildTemplate.js.map +0 -1
- package/dist/lib/structures/IdentifiableBase.d.ts +0 -15
- package/dist/lib/structures/IdentifiableBase.js +0 -25
- package/dist/lib/structures/IdentifiableBase.js.map +0 -1
- package/dist/lib/structures/Integration.d.ts +0 -31
- package/dist/lib/structures/Integration.js +0 -103
- package/dist/lib/structures/Integration.js.map +0 -1
- package/dist/lib/structures/Interaction.d.ts +0 -76
- package/dist/lib/structures/Interaction.js +0 -346
- package/dist/lib/structures/Interaction.js.map +0 -1
- package/dist/lib/structures/Invite.d.ts +0 -26
- package/dist/lib/structures/Invite.js +0 -82
- package/dist/lib/structures/Invite.js.map +0 -1
- package/dist/lib/structures/Message.d.ts +0 -86
- package/dist/lib/structures/Message.js +0 -303
- package/dist/lib/structures/Message.js.map +0 -1
- package/dist/lib/structures/Role.d.ts +0 -37
- package/dist/lib/structures/Role.js +0 -90
- package/dist/lib/structures/Role.js.map +0 -1
- package/dist/lib/structures/SKU.d.ts +0 -23
- package/dist/lib/structures/SKU.js +0 -63
- package/dist/lib/structures/SKU.js.map +0 -1
- package/dist/lib/structures/StageInstance.d.ts +0 -24
- package/dist/lib/structures/StageInstance.js +0 -57
- package/dist/lib/structures/StageInstance.js.map +0 -1
- package/dist/lib/structures/Sticker.d.ts +0 -31
- package/dist/lib/structures/Sticker.js +0 -86
- package/dist/lib/structures/Sticker.js.map +0 -1
- package/dist/lib/structures/Team.d.ts +0 -14
- package/dist/lib/structures/Team.js +0 -39
- package/dist/lib/structures/Team.js.map +0 -1
- package/dist/lib/structures/TestEntitlement.d.ts +0 -23
- package/dist/lib/structures/TestEntitlement.js +0 -61
- package/dist/lib/structures/TestEntitlement.js.map +0 -1
- package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
- package/dist/lib/structures/UnavailableGuild.js +0 -25
- package/dist/lib/structures/UnavailableGuild.js.map +0 -1
- package/dist/lib/structures/User.d.ts +0 -63
- package/dist/lib/structures/User.js +0 -177
- package/dist/lib/structures/User.js.map +0 -1
- package/dist/lib/structures/VoiceState.d.ts +0 -24
- package/dist/lib/structures/VoiceState.js +0 -66
- package/dist/lib/structures/VoiceState.js.map +0 -1
- package/dist/lib/structures/Webhook.d.ts +0 -82
- package/dist/lib/structures/Webhook.js +0 -223
- package/dist/lib/structures/Webhook.js.map +0 -1
- package/dist/lib/structures/index.d.ts +0 -28
- package/dist/lib/structures/index.js +0 -45
- package/dist/lib/structures/index.js.map +0 -1
- package/dist/lib/types/application-command.js.map +0 -1
- package/dist/lib/types/application-role-connection-metadata.js.map +0 -1
- package/dist/lib/types/application.js.map +0 -1
- package/dist/lib/types/audit-log.js.map +0 -1
- package/dist/lib/types/auto-moderation.js.map +0 -1
- package/dist/lib/types/channel.js.map +0 -1
- package/dist/lib/types/emoji.js.map +0 -1
- package/dist/lib/types/entitlements.js.map +0 -1
- package/dist/lib/types/gateway-events.js.map +0 -1
- package/dist/lib/types/guild-scheduled-event.js.map +0 -1
- package/dist/lib/types/guild-template.js.map +0 -1
- package/dist/lib/types/guild.js.map +0 -1
- package/dist/lib/types/index.js.map +0 -1
- package/dist/lib/types/interaction.js.map +0 -1
- package/dist/lib/types/invite.js.map +0 -1
- package/dist/lib/types/message-components.js.map +0 -1
- package/dist/lib/types/role.js.map +0 -1
- package/dist/lib/types/sku.js.map +0 -1
- package/dist/lib/types/stage-instance.js.map +0 -1
- package/dist/lib/types/sticker.js.map +0 -1
- package/dist/lib/types/team.js.map +0 -1
- package/dist/lib/types/user.js.map +0 -1
- package/dist/lib/types/voice.js.map +0 -1
- package/dist/lib/types/webhook.js.map +0 -1
- package/dist/lib/utils/Collection.d.ts +0 -24
- package/dist/lib/utils/Collection.js +0 -65
- package/dist/lib/utils/Collection.js.map +0 -1
- package/dist/lib/utils/Util.js.map +0 -1
- package/dist/lib/utils/errors.js.map +0 -1
- package/dist/lib/utils/index.js.map +0 -1
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,
|
@@ -1278,10 +1278,15 @@ class Client extends node_events_1.default {
|
|
1278
1278
|
})
|
1279
1279
|
.then((response) => response !== null ? this.util.toCamelCase(response) : null);
|
1280
1280
|
}
|
1281
|
+
expirePoll(channelId, messageId) {
|
1282
|
+
return this.rest
|
1283
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelId, messageId))
|
1284
|
+
.then((response) => this.util.toCamelCase(response));
|
1285
|
+
}
|
1281
1286
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
1282
1287
|
followChannel(channelId, options) {
|
1283
1288
|
return this.rest
|
1284
|
-
.request(rest_1.
|
1289
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelFollowers(channelId), {
|
1285
1290
|
json: {
|
1286
1291
|
webhook_channel_id: options.webhookChannelId,
|
1287
1292
|
},
|
@@ -1291,13 +1296,13 @@ class Client extends node_events_1.default {
|
|
1291
1296
|
/** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
|
1292
1297
|
getActiveGuildThreads(guildId) {
|
1293
1298
|
return this.rest
|
1294
|
-
.request(rest_1.
|
1299
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildActiveThreads(guildId))
|
1295
1300
|
.then((response) => this.util.toCamelCase(response));
|
1296
1301
|
}
|
1297
1302
|
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads */
|
1298
1303
|
getArchivedThreads(channelId, archivedStatus, options) {
|
1299
1304
|
return this.rest
|
1300
|
-
.request(rest_1.
|
1305
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(channelId, archivedStatus, false), {
|
1301
1306
|
query: {
|
1302
1307
|
before: options?.before,
|
1303
1308
|
limit: options?.limit,
|
@@ -1308,7 +1313,7 @@ class Client extends node_events_1.default {
|
|
1308
1313
|
/** https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log */
|
1309
1314
|
getAuditLog(guildId, options) {
|
1310
1315
|
return this.rest
|
1311
|
-
.request(rest_1.
|
1316
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAuditLog(guildId), {
|
1312
1317
|
query: {
|
1313
1318
|
user_id: options?.userId,
|
1314
1319
|
action_type: options?.actionType,
|
@@ -1322,79 +1327,79 @@ class Client extends node_events_1.default {
|
|
1322
1327
|
/** https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule */
|
1323
1328
|
getAutoModerationRule(guildId, ruleId) {
|
1324
1329
|
return this.rest
|
1325
|
-
.request(rest_1.
|
1330
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRule(guildId, ruleId))
|
1326
1331
|
.then((response) => this.util.toCamelCase(response));
|
1327
1332
|
}
|
1328
1333
|
/** https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild */
|
1329
1334
|
getAutoModerationRules(guildId) {
|
1330
1335
|
return this.rest
|
1331
|
-
.request(rest_1.
|
1336
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildAutoModerationRules(guildId))
|
1332
1337
|
.then((response) => response.map((autoModerationRule) => this.util.toCamelCase(autoModerationRule)));
|
1333
1338
|
}
|
1334
1339
|
/** https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions */
|
1335
1340
|
getApplicationCommandPermissions(applicationId, guildId, commandId) {
|
1336
1341
|
return this.rest
|
1337
|
-
.request(rest_1.
|
1342
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommandPermissions(applicationId, guildId, commandId))
|
1338
1343
|
.then((response) => this.util.toCamelCase(response));
|
1339
1344
|
}
|
1340
1345
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records */
|
1341
1346
|
getApplicationRoleConnectionMetadataRecords(applicationId) {
|
1342
1347
|
return this.rest
|
1343
|
-
.request(rest_1.
|
1348
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationId))
|
1344
1349
|
.then((response) => response.map((applicationRoleConnectionMetadata) => this.util.toCamelCase(applicationRoleConnectionMetadata)));
|
1345
1350
|
}
|
1346
1351
|
/** https://discord.com/developers/docs/resources/channel#get-channel */
|
1347
1352
|
getChannel(channelId) {
|
1348
1353
|
return this.rest
|
1349
|
-
.request(rest_1.
|
1354
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channel(channelId))
|
1350
1355
|
.then((response) => this.util.toCamelCase(response));
|
1351
1356
|
}
|
1352
1357
|
/** https://discord.com/developers/docs/resources/guild#get-guild-channels */
|
1353
1358
|
getChannels(guildId) {
|
1354
1359
|
return this.rest
|
1355
|
-
.request(rest_1.
|
1360
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildChannels(guildId))
|
1356
1361
|
.then((response) => response.map((channel) => this.util.toCamelCase(channel)));
|
1357
1362
|
}
|
1358
1363
|
/** https://discord.com/developers/docs/resources/channel#get-channel-invites */
|
1359
1364
|
getChannelInvites(channelId) {
|
1360
1365
|
return this.rest
|
1361
|
-
.request(rest_1.
|
1366
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelInvites(channelId))
|
1362
1367
|
.then((response) => response.map((invite) => this.util.toCamelCase(invite)));
|
1363
1368
|
}
|
1364
1369
|
/** https://discord.com/developers/docs/resources/webhook#get-channel-webhooks */
|
1365
1370
|
getChannelWebhooks(channelId) {
|
1366
1371
|
return this.rest
|
1367
|
-
.request(rest_1.
|
1372
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelWebhooks(channelId))
|
1368
1373
|
.then((response) => response.map((webhook) => this.util.toCamelCase(webhook)));
|
1369
1374
|
}
|
1370
1375
|
/** https://discord.com/developers/docs/resources/application#get-current-application */
|
1371
1376
|
getCurrentApplication() {
|
1372
1377
|
return this.rest
|
1373
|
-
.request(rest_1.
|
1378
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCurrentUser())
|
1374
1379
|
.then((response) => this.util.toCamelCase(response));
|
1375
1380
|
}
|
1376
1381
|
/** https://discord.com/developers/docs/resources/user#get-current-user-application-role-connection */
|
1377
1382
|
getCurrentApplicationRoleConnection(applicationId) {
|
1378
1383
|
return this.rest
|
1379
|
-
.request(rest_1.
|
1384
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userApplicationRoleConnection(applicationId))
|
1380
1385
|
.then((response) => this.util.toCamelCase(response));
|
1381
1386
|
}
|
1382
1387
|
/** https://discord.com/developers/docs/resources/user#get-current-user-guild-member */
|
1383
1388
|
getCurrentGuildMember(guildId) {
|
1384
1389
|
return this.rest
|
1385
|
-
.request(rest_1.
|
1390
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(guildId))
|
1386
1391
|
.then((response) => this.util.toCamelCase(response));
|
1387
1392
|
}
|
1388
1393
|
/** https://discord.com/developers/docs/resources/user#get-current-user-connections */
|
1389
1394
|
getCurrentUserConnections() {
|
1390
1395
|
return this.rest
|
1391
|
-
.request(rest_1.
|
1396
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userConnections())
|
1392
1397
|
.then((response) => response.map((connection) => this.util.toCamelCase(connection)));
|
1393
1398
|
}
|
1394
1399
|
/** https://discord.com/developers/docs/monetization/entitlements#list-entitlements */
|
1395
1400
|
getEntitlements(applicationId, options) {
|
1396
1401
|
return this.rest
|
1397
|
-
.request(rest_1.
|
1402
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationEntitlements(applicationId), {
|
1398
1403
|
query: {
|
1399
1404
|
user_id: options?.userId,
|
1400
1405
|
sku_ids: options?.skuIds,
|
@@ -1409,24 +1414,24 @@ class Client extends node_events_1.default {
|
|
1409
1414
|
}
|
1410
1415
|
/** https://discord.com/developers/docs/topics/gateway#get-gateway */
|
1411
1416
|
getGateway() {
|
1412
|
-
return this.rest.request(rest_1.
|
1417
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.gateway());
|
1413
1418
|
}
|
1414
1419
|
/** https://discord.com/developers/docs/topics/gateway#get-gateway-bot */
|
1415
1420
|
getGatewayBot() {
|
1416
1421
|
return this.rest
|
1417
|
-
.request(rest_1.
|
1422
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.gatewayBot())
|
1418
1423
|
.then((response) => this.util.toCamelCase(response));
|
1419
1424
|
}
|
1420
1425
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-command */
|
1421
1426
|
getGlobalApplicationCommand(applicationId, commandId) {
|
1422
1427
|
return this.rest
|
1423
|
-
.request(rest_1.
|
1428
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommand(applicationId, commandId))
|
1424
1429
|
.then((response) => this.util.toCamelCase(response));
|
1425
1430
|
}
|
1426
1431
|
/** https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands */
|
1427
1432
|
getGlobalApplicationCommands(applicationId, options) {
|
1428
1433
|
return this.rest
|
1429
|
-
.request(rest_1.
|
1434
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationCommands(applicationId), {
|
1430
1435
|
query: {
|
1431
1436
|
with_localizations: options.withLocalizations,
|
1432
1437
|
},
|
@@ -1436,7 +1441,7 @@ class Client extends node_events_1.default {
|
|
1436
1441
|
/** https://discord.com/developers/docs/resources/guild#get-guild */
|
1437
1442
|
getGuild(guildId, options) {
|
1438
1443
|
return this.rest
|
1439
|
-
.request(rest_1.
|
1444
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guild(guildId), {
|
1440
1445
|
query: {
|
1441
1446
|
with_counts: options?.withCounts,
|
1442
1447
|
},
|
@@ -1446,7 +1451,7 @@ class Client extends node_events_1.default {
|
|
1446
1451
|
/** https://discord.com/developers/docs/resources/user#get-current-user-guilds */
|
1447
1452
|
getGuilds(options) {
|
1448
1453
|
return this.rest
|
1449
|
-
.request(rest_1.
|
1454
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.userGuilds(), {
|
1450
1455
|
query: {
|
1451
1456
|
before: options?.before,
|
1452
1457
|
after: options?.after,
|
@@ -1459,13 +1464,13 @@ class Client extends node_events_1.default {
|
|
1459
1464
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command */
|
1460
1465
|
getGuildApplicationCommand(applicationId, guildId, commandId) {
|
1461
1466
|
return this.rest
|
1462
|
-
.request(rest_1.
|
1467
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommand(applicationId, guildId, commandId))
|
1463
1468
|
.then((response) => this.util.toCamelCase(response));
|
1464
1469
|
}
|
1465
1470
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands */
|
1466
1471
|
getGuildApplicationCommands(applicationId, guildId, options) {
|
1467
1472
|
return this.rest
|
1468
|
-
.request(rest_1.
|
1473
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationGuildCommands(applicationId, guildId), {
|
1469
1474
|
query: {
|
1470
1475
|
with_localizations: options?.withLocalizations,
|
1471
1476
|
},
|
@@ -1475,19 +1480,19 @@ class Client extends node_events_1.default {
|
|
1475
1480
|
/** https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions */
|
1476
1481
|
getGuildApplicationCommandPermissions(applicationId, guildId) {
|
1477
1482
|
return this.rest
|
1478
|
-
.request(rest_1.
|
1483
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildApplicationCommandsPermissions(applicationId, guildId))
|
1479
1484
|
.then((response) => this.util.toCamelCase(response));
|
1480
1485
|
}
|
1481
1486
|
/** https://discord.com/developers/docs/resources/guild#get-guild-ban */
|
1482
1487
|
getGuildBan(guildId, userId) {
|
1483
1488
|
return this.rest
|
1484
|
-
.request(rest_1.
|
1489
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBan(guildId, userId))
|
1485
1490
|
.then((response) => this.util.toCamelCase(response));
|
1486
1491
|
}
|
1487
1492
|
/** https://discord.com/developers/docs/resources/guild#get-guild-bans */
|
1488
1493
|
getGuildBans(guildId, options) {
|
1489
1494
|
return this.rest
|
1490
|
-
.request(rest_1.
|
1495
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildBans(guildId), {
|
1491
1496
|
query: {
|
1492
1497
|
limit: options?.limit,
|
1493
1498
|
before: options?.before,
|
@@ -1499,55 +1504,55 @@ class Client extends node_events_1.default {
|
|
1499
1504
|
/** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
|
1500
1505
|
getGuildEmoji(guildId, emojiId) {
|
1501
1506
|
return this.rest
|
1502
|
-
.request(rest_1.
|
1507
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmoji(guildId, emojiId))
|
1503
1508
|
.then((response) => this.util.toCamelCase(response));
|
1504
1509
|
}
|
1505
1510
|
/** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
|
1506
1511
|
getGuildEmojis(guildId) {
|
1507
1512
|
return this.rest
|
1508
|
-
.request(rest_1.
|
1513
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildEmojis(guildId))
|
1509
1514
|
.then((response) => response.map((emoji) => this.util.toCamelCase(emoji)));
|
1510
1515
|
}
|
1511
1516
|
/** https://discord.com/developers/docs/resources/guild#get-guild-integrations */
|
1512
1517
|
getGuildIntegrations(guildId) {
|
1513
1518
|
return this.rest
|
1514
|
-
.request(rest_1.
|
1519
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildIntegrations(guildId))
|
1515
1520
|
.then((response) => response.map((integration) => this.util.toCamelCase(integration)));
|
1516
1521
|
}
|
1517
1522
|
/** https://discord.com/developers/docs/resources/guild#get-guild-invites */
|
1518
1523
|
getGuildInvites(guildId) {
|
1519
1524
|
return this.rest
|
1520
|
-
.request(rest_1.
|
1525
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildInvites(guildId))
|
1521
1526
|
.then((response) => response.map((invite) => this.util.toCamelCase(invite)));
|
1522
1527
|
}
|
1523
1528
|
/** https://discord.com/developers/docs/resources/guild#get-guild-member */
|
1524
1529
|
getGuildMember(guildId, userId) {
|
1525
1530
|
return this.rest
|
1526
|
-
.request(rest_1.
|
1531
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMember(guildId, userId))
|
1527
1532
|
.then((response) => this.util.toCamelCase(response));
|
1528
1533
|
}
|
1529
1534
|
/** https://discord.com/developers/docs/resources/guild#list-guild-members */
|
1530
1535
|
getGuildMembers(guildId) {
|
1531
1536
|
return this.rest
|
1532
|
-
.request(rest_1.
|
1537
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembers(guildId))
|
1533
1538
|
.then((response) => response.map((guildMember) => this.util.toCamelCase(guildMember)));
|
1534
1539
|
}
|
1535
1540
|
/** https://discord.com/developers/docs/resources/guild#get-guild-onboarding */
|
1536
1541
|
getGuildOnboarding(guildId) {
|
1537
1542
|
return this.rest
|
1538
|
-
.request(rest_1.
|
1543
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildOnboarding(guildId))
|
1539
1544
|
.then((response) => this.util.toCamelCase(response));
|
1540
1545
|
}
|
1541
1546
|
/** https://discord.com/developers/docs/resources/guild#get-guild-preview */
|
1542
1547
|
getGuildPreview(guildId) {
|
1543
1548
|
return this.rest
|
1544
|
-
.request(rest_1.
|
1549
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPreview(guildId))
|
1545
1550
|
.then((response) => this.util.toCamelCase(response));
|
1546
1551
|
}
|
1547
1552
|
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count */
|
1548
1553
|
getGuildPruneCount(guildId, options) {
|
1549
1554
|
return this.rest
|
1550
|
-
.request(rest_1.
|
1555
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildPrune(guildId), {
|
1551
1556
|
query: {
|
1552
1557
|
days: options.days,
|
1553
1558
|
include_roles: options.includeRoles,
|
@@ -1558,13 +1563,13 @@ class Client extends node_events_1.default {
|
|
1558
1563
|
/** https://discord.com/developers/docs/resources/guild#get-guild-roles */
|
1559
1564
|
getGuildRoles(guildId) {
|
1560
1565
|
return this.rest
|
1561
|
-
.request(rest_1.
|
1566
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildRoles(guildId))
|
1562
1567
|
.then((response) => response.map((role) => this.util.toCamelCase(role)));
|
1563
1568
|
}
|
1564
1569
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild */
|
1565
1570
|
getGuildScheduledEvents(guildId, options) {
|
1566
1571
|
return this.rest
|
1567
|
-
.request(rest_1.
|
1572
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvents(guildId), {
|
1568
1573
|
query: {
|
1569
1574
|
with_user_count: options?.withUserCount,
|
1570
1575
|
},
|
@@ -1574,7 +1579,7 @@ class Client extends node_events_1.default {
|
|
1574
1579
|
/** https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users */
|
1575
1580
|
getGuildScheduledEventUsers(guildId, guildScheduledEventId, options) {
|
1576
1581
|
return this.rest
|
1577
|
-
.request(rest_1.
|
1582
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildScheduledEvent(guildId, guildScheduledEventId), {
|
1578
1583
|
query: {
|
1579
1584
|
limit: options?.limit,
|
1580
1585
|
with_member: options?.withMember,
|
@@ -1587,52 +1592,52 @@ class Client extends node_events_1.default {
|
|
1587
1592
|
/** https://discord.com/developers/docs/resources/sticker#get-guild-sticker */
|
1588
1593
|
getGuildSticker(guildId, stickerId) {
|
1589
1594
|
return this.rest
|
1590
|
-
.request(rest_1.
|
1595
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildSticker(guildId, stickerId))
|
1591
1596
|
.then((response) => this.util.toCamelCase(response));
|
1592
1597
|
}
|
1593
1598
|
/** https://discord.com/developers/docs/resources/sticker#list-guild-stickers */
|
1594
1599
|
getGuildStickers(guildId) {
|
1595
1600
|
return this.rest
|
1596
|
-
.request(rest_1.
|
1601
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildStickers(guildId))
|
1597
1602
|
.then((response) => response.map((sticker) => this.util.toCamelCase(sticker)));
|
1598
1603
|
}
|
1599
1604
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-template */
|
1600
1605
|
getGuildTemplate(guildId, code) {
|
1601
1606
|
return this.rest
|
1602
|
-
.request(rest_1.
|
1607
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplate(guildId, code))
|
1603
1608
|
.then((response) => this.util.toCamelCase(response));
|
1604
1609
|
}
|
1605
1610
|
/** https://discord.com/developers/docs/resources/guild-template#get-guild-templates */
|
1606
1611
|
getGuildTemplates(guildId) {
|
1607
1612
|
return this.rest
|
1608
|
-
.request(rest_1.
|
1613
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildTemplates(guildId))
|
1609
1614
|
.then((response) => response.map((guildTemplate) => this.util.toCamelCase(guildTemplate)));
|
1610
1615
|
}
|
1611
1616
|
/** https://discord.com/developers/docs/resources/guild#get-guild-vanity-url */
|
1612
1617
|
getGuildVanityUrl(guildId) {
|
1613
|
-
return this.rest.request(rest_1.
|
1618
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVanityUrl(guildId));
|
1614
1619
|
}
|
1615
1620
|
/** https://discord.com/developers/docs/resources/guild#get-guild-voice-regions */
|
1616
1621
|
getGuildVoiceRegions(guildId) {
|
1617
1622
|
return this.rest
|
1618
|
-
.request(rest_1.
|
1623
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildVoiceRegions(guildId))
|
1619
1624
|
.then((response) => response.map((VoiceRegion) => this.util.toCamelCase(VoiceRegion)));
|
1620
1625
|
}
|
1621
1626
|
/** https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen */
|
1622
1627
|
getGuildWelcomeScreen(guildId) {
|
1623
1628
|
return this.rest
|
1624
|
-
.request(rest_1.
|
1629
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWelcomeScreen(guildId))
|
1625
1630
|
.then((response) => this.util.toCamelCase(response));
|
1626
1631
|
}
|
1627
1632
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget */
|
1628
1633
|
getGuildWidget(guildId) {
|
1629
1634
|
return this.rest
|
1630
|
-
.request(rest_1.
|
1635
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetJSON(guildId))
|
1631
1636
|
.then((response) => this.util.toCamelCase(response));
|
1632
1637
|
}
|
1633
1638
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-image */
|
1634
1639
|
getGuildWidgetImage(guildId, options) {
|
1635
|
-
return this.rest.request(rest_1.
|
1640
|
+
return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetImage(guildId), {
|
1636
1641
|
query: {
|
1637
1642
|
style: options?.style,
|
1638
1643
|
},
|
@@ -1641,13 +1646,13 @@ class Client extends node_events_1.default {
|
|
1641
1646
|
/** https://discord.com/developers/docs/resources/guild#get-guild-widget-settings */
|
1642
1647
|
getGuildWidgetSettings(guildId) {
|
1643
1648
|
return this.rest
|
1644
|
-
.request(rest_1.
|
1649
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWidgetSettings(guildId))
|
1645
1650
|
.then((response) => this.util.toCamelCase(response));
|
1646
1651
|
}
|
1647
1652
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message */
|
1648
1653
|
getInteractionFollowupMessage(applicationId, interactionToken, messageId, options) {
|
1649
1654
|
return this.rest
|
1650
|
-
.request(rest_1.
|
1655
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(applicationId, interactionToken, messageId), {
|
1651
1656
|
query: {
|
1652
1657
|
thread_id: options?.threadId,
|
1653
1658
|
},
|
@@ -1657,7 +1662,7 @@ class Client extends node_events_1.default {
|
|
1657
1662
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response */
|
1658
1663
|
getInteractionResponse(applicationId, interactionToken, options) {
|
1659
1664
|
return this.rest
|
1660
|
-
.request(rest_1.
|
1665
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(applicationId, interactionToken), {
|
1661
1666
|
query: {
|
1662
1667
|
thread_id: options?.threadId,
|
1663
1668
|
},
|
@@ -1667,7 +1672,7 @@ class Client extends node_events_1.default {
|
|
1667
1672
|
/** https://discord.com/developers/docs/resources/invite#get-invite */
|
1668
1673
|
getInvite(code, options) {
|
1669
1674
|
return this.rest
|
1670
|
-
.request(rest_1.
|
1675
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.invite(code), {
|
1671
1676
|
query: {
|
1672
1677
|
with_counts: options?.withCounts,
|
1673
1678
|
with_expiration: options?.withExpiration,
|
@@ -1679,7 +1684,7 @@ class Client extends node_events_1.default {
|
|
1679
1684
|
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads */
|
1680
1685
|
getJoinedPrivateArchivedThreads(channelId, options) {
|
1681
1686
|
return this.rest
|
1682
|
-
.request(rest_1.
|
1687
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelThreads(channelId, "private", true), {
|
1683
1688
|
query: {
|
1684
1689
|
before: options?.before,
|
1685
1690
|
limit: options?.limit,
|
@@ -1690,13 +1695,13 @@ class Client extends node_events_1.default {
|
|
1690
1695
|
/** https://discord.com/developers/docs/resources/channel#get-channel-message */
|
1691
1696
|
getMessage(channelId, messageId) {
|
1692
1697
|
return this.rest
|
1693
|
-
.request(rest_1.
|
1698
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelId, messageId))
|
1694
1699
|
.then((response) => this.util.toCamelCase(response));
|
1695
1700
|
}
|
1696
1701
|
/** https://discord.com/developers/docs/resources/channel#get-reactions */
|
1697
1702
|
getMessageReactions(channelId, messageId, emoji, options) {
|
1698
1703
|
return this.rest
|
1699
|
-
.request(rest_1.
|
1704
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessageAllReactions(channelId, messageId, emoji), {
|
1700
1705
|
query: {
|
1701
1706
|
after: options?.after,
|
1702
1707
|
limit: options?.limit,
|
@@ -1707,7 +1712,7 @@ class Client extends node_events_1.default {
|
|
1707
1712
|
/** https://discord.com/developers/docs/resources/channel#get-channel-messages */
|
1708
1713
|
getMessages(channelId, options) {
|
1709
1714
|
return this.rest
|
1710
|
-
.request(rest_1.
|
1715
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessages(channelId), {
|
1711
1716
|
query: {
|
1712
1717
|
around: options.around,
|
1713
1718
|
before: options.before,
|
@@ -1720,43 +1725,53 @@ class Client extends node_events_1.default {
|
|
1720
1725
|
/** https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information */
|
1721
1726
|
getOAuth2Application() {
|
1722
1727
|
return this.rest
|
1723
|
-
.request(rest_1.
|
1728
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.oauth2CurrentApplication())
|
1724
1729
|
.then((response) => this.util.toCamelCase(response));
|
1725
1730
|
}
|
1726
1731
|
/** https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information */
|
1727
1732
|
getOAuth2Authorization() {
|
1728
1733
|
return this.rest
|
1729
|
-
.request(rest_1.
|
1734
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.oauth2Authorization())
|
1730
1735
|
.then((response) => this.util.toCamelCase(response));
|
1731
1736
|
}
|
1732
1737
|
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
1733
1738
|
getPinnedMessages(channelId) {
|
1734
1739
|
return this.rest
|
1735
|
-
.request(rest_1.
|
1740
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelId))
|
1736
1741
|
.then((response) => response.map((message) => this.util.toCamelCase(message)));
|
1737
1742
|
}
|
1743
|
+
getPollAnswerVoters(channelId, messageId, answerId, options) {
|
1744
|
+
return this.rest
|
1745
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.pollAnswerVoters(channelId, messageId, answerId), {
|
1746
|
+
query: {
|
1747
|
+
after: options?.after,
|
1748
|
+
limit: options?.limit,
|
1749
|
+
},
|
1750
|
+
})
|
1751
|
+
.then((response) => this.util.toCamelCase(response));
|
1752
|
+
}
|
1738
1753
|
/** https://discord.com/developers/docs/monetization/skus#list-skus */
|
1739
1754
|
getSkus(applicationId) {
|
1740
1755
|
return this.rest
|
1741
|
-
.request(rest_1.
|
1756
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.applicationSkus(applicationId))
|
1742
1757
|
.then((response) => response.map((sku) => this.util.toCamelCase(sku)));
|
1743
1758
|
}
|
1744
1759
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
1745
1760
|
getStageInstance(channelId) {
|
1746
1761
|
return this.rest
|
1747
|
-
.request(rest_1.
|
1762
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stageInstance(channelId))
|
1748
1763
|
.then((response) => this.util.toCamelCase(response));
|
1749
1764
|
}
|
1750
1765
|
/** https://discord.com/developers/docs/resources/sticker#list-sticker-packs */
|
1751
1766
|
getStickerPacks() {
|
1752
1767
|
return this.rest
|
1753
|
-
.request(rest_1.
|
1768
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.stickerPacks())
|
1754
1769
|
.then((response) => this.util.toCamelCase(response));
|
1755
1770
|
}
|
1756
1771
|
/** https://discord.com/developers/docs/resources/channel#get-thread-member */
|
1757
1772
|
getThreadMember(channelId, userId, options) {
|
1758
1773
|
return this.rest
|
1759
|
-
.request(rest_1.
|
1774
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(channelId, userId), {
|
1760
1775
|
query: {
|
1761
1776
|
with_member: options?.withMember,
|
1762
1777
|
},
|
@@ -1766,7 +1781,7 @@ class Client extends node_events_1.default {
|
|
1766
1781
|
/** https://discord.com/developers/docs/resources/channel#list-thread-members */
|
1767
1782
|
getThreadMembers(channelId, options) {
|
1768
1783
|
return this.rest
|
1769
|
-
.request(rest_1.
|
1784
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.threadMembers(channelId), {
|
1770
1785
|
query: {
|
1771
1786
|
with_member: options?.withMember,
|
1772
1787
|
after: options?.after,
|
@@ -1778,19 +1793,19 @@ class Client extends node_events_1.default {
|
|
1778
1793
|
/** https://discord.com/developers/docs/resources/user#get-user */
|
1779
1794
|
getUser(userId) {
|
1780
1795
|
return this.rest
|
1781
|
-
.request(rest_1.
|
1796
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.user(userId))
|
1782
1797
|
.then((response) => this.util.toCamelCase(response));
|
1783
1798
|
}
|
1784
1799
|
/** https://discord.com/developers/docs/resources/voice#list-voice-regions */
|
1785
1800
|
getVoiceRegions() {
|
1786
1801
|
return this.rest
|
1787
|
-
.request(rest_1.
|
1802
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.voiceRegions())
|
1788
1803
|
.then((response) => response.map((voiceRegion) => this.util.toCamelCase(voiceRegion)));
|
1789
1804
|
}
|
1790
1805
|
/** https://discord.com/developers/docs/resources/webhook#get-webhook-message */
|
1791
1806
|
getWebhookMessage(webhookId, webhookToken, messageId, options) {
|
1792
1807
|
return this.rest
|
1793
|
-
.request(rest_1.
|
1808
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.webhookMessage(webhookId, webhookToken, messageId), {
|
1794
1809
|
query: {
|
1795
1810
|
thread_id: options?.threadId,
|
1796
1811
|
},
|
@@ -1800,12 +1815,12 @@ class Client extends node_events_1.default {
|
|
1800
1815
|
/** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
|
1801
1816
|
getWebhooks(guildId) {
|
1802
1817
|
return this.rest
|
1803
|
-
.request(rest_1.
|
1818
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(guildId))
|
1804
1819
|
.then((response) => response.map((webhook) => this.util.toCamelCase(webhook)));
|
1805
1820
|
}
|
1806
1821
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
1807
1822
|
joinThread(channelId) {
|
1808
|
-
this.rest.request(rest_1.
|
1823
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelId, "@me"));
|
1809
1824
|
}
|
1810
1825
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
1811
1826
|
joinVoiceChannel(guildId, channelId, options) {
|
@@ -1821,11 +1836,11 @@ class Client extends node_events_1.default {
|
|
1821
1836
|
}
|
1822
1837
|
/** https://discord.com/developers/docs/resources/user#leave-guild */
|
1823
1838
|
leaveGuild(guildId) {
|
1824
|
-
this.rest.request(rest_1.
|
1839
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(guildId));
|
1825
1840
|
}
|
1826
1841
|
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
1827
1842
|
leaveThread(channelId) {
|
1828
|
-
this.rest.request(rest_1.
|
1843
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelId, "@me"));
|
1829
1844
|
}
|
1830
1845
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
1831
1846
|
leaveVoiceChannel(guildId) {
|
@@ -1841,40 +1856,40 @@ class Client extends node_events_1.default {
|
|
1841
1856
|
}
|
1842
1857
|
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
1843
1858
|
pinMessage(channelId, messageId, reason) {
|
1844
|
-
this.rest.request(rest_1.
|
1859
|
+
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(channelId, messageId), {
|
1845
1860
|
reason,
|
1846
1861
|
});
|
1847
1862
|
}
|
1848
1863
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
|
1849
1864
|
removeBan(guildId, userId, reason) {
|
1850
|
-
this.rest.request(rest_1.
|
1865
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildBan(guildId, userId), {
|
1851
1866
|
reason,
|
1852
1867
|
});
|
1853
1868
|
}
|
1854
1869
|
/** https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient */
|
1855
1870
|
removeGroupRecipient(channelId, userId) {
|
1856
|
-
this.rest.request(rest_1.
|
1871
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelRecipient(channelId, userId));
|
1857
1872
|
}
|
1858
1873
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member */
|
1859
1874
|
removeGuildMember(guildId, userId, reason) {
|
1860
|
-
this.rest.request(rest_1.
|
1875
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMember(guildId, userId), {
|
1861
1876
|
reason,
|
1862
1877
|
});
|
1863
1878
|
}
|
1864
1879
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
1865
1880
|
removeGuildMemberRole(guildId, userId, roleId, reason) {
|
1866
|
-
this.rest.request(rest_1.
|
1881
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.guildMemberRole(guildId, userId, roleId), {
|
1867
1882
|
reason,
|
1868
1883
|
});
|
1869
1884
|
}
|
1870
1885
|
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
1871
1886
|
removeThreadMember(channelId, userId) {
|
1872
|
-
this.rest.request(rest_1.
|
1887
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelId, userId));
|
1873
1888
|
}
|
1874
1889
|
/** https://discord.com/developers/docs/resources/guild#search-guild-members */
|
1875
1890
|
searchGuildMembers(guildId, options) {
|
1876
1891
|
return this.rest
|
1877
|
-
.request(rest_1.
|
1892
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMembersSearch(guildId), {
|
1878
1893
|
query: {
|
1879
1894
|
query: options.query,
|
1880
1895
|
limit: options.limit,
|
@@ -1890,23 +1905,23 @@ class Client extends node_events_1.default {
|
|
1890
1905
|
/** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
|
1891
1906
|
syncGuildTemplate(guildId, code) {
|
1892
1907
|
return this.rest
|
1893
|
-
.request(rest_1.
|
1908
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildTemplate(guildId, code))
|
1894
1909
|
.then((response) => this.util.toCamelCase(response));
|
1895
1910
|
}
|
1896
1911
|
/** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
|
1897
1912
|
triggerTypingIndicator(channelId) {
|
1898
|
-
this.rest.request(rest_1.
|
1913
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(channelId));
|
1899
1914
|
}
|
1900
1915
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
1901
1916
|
updateApplicationRoleConnectionMetadataRecords(applicationId) {
|
1902
1917
|
return this.rest
|
1903
|
-
.request(rest_1.
|
1918
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationId))
|
1904
1919
|
.then((response) => response.map((applicationRoleConnectionMetadata) => this.util.toCamelCase(applicationRoleConnectionMetadata)));
|
1905
1920
|
}
|
1906
1921
|
/** https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection */
|
1907
1922
|
updateCurrentApplicationRoleConnection(options) {
|
1908
1923
|
return this.rest
|
1909
|
-
.request(rest_1.
|
1924
|
+
.request(rest_1.RESTMethods.Put, rest_1.Endpoints.userApplicationRoleConnection(this.application.id), {
|
1910
1925
|
json: {
|
1911
1926
|
platform_name: options.platformName,
|
1912
1927
|
platform_username: options.platformUsername,
|
@@ -1917,10 +1932,9 @@ class Client extends node_events_1.default {
|
|
1917
1932
|
}
|
1918
1933
|
/** https://discord.com/developers/docs/resources/channel#unpin-message */
|
1919
1934
|
unpinMessage(channelId, messageId, reason) {
|
1920
|
-
this.rest.request(rest_1.
|
1935
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPin(channelId, messageId), {
|
1921
1936
|
reason,
|
1922
1937
|
});
|
1923
1938
|
}
|
1924
1939
|
}
|
1925
1940
|
exports.Client = Client;
|
1926
|
-
//# sourceMappingURL=Client.js.map
|