@discordeno/rest 22.0.1-next.0e2a332 → 22.0.1-next.0e7a430

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/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import type { AddDmRecipientOptions, AddGuildMemberOptions, AddLobbyMember, AtLeastOne, BeginGuildPrune, BigString, BulkUpdateLobbyMember, Camelize, CreateApplicationCommand, CreateApplicationEmoji, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGlobalApplicationCommandOptions, CreateGroupDmOptions, CreateGuildApplicationCommandOptions, CreateGuildBan, CreateGuildBulkBan, CreateGuildChannel, CreateGuildEmoji, CreateGuildRole, CreateGuildSoundboardSound, CreateGuildStickerOptions, CreateLobby, CreateMessageOptions, CreateOrJoinLobby, CreateScheduledEvent, CreateStageInstance, CreateTemplate, CreateTestEntitlement, CreateWebhook, DeleteWebhookMessageOptions, DiscordAccessTokenResponse, DiscordActivityInstance, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordApplicationRoleConnection, DiscordApplicationRoleConnectionMetadata, DiscordAuditLog, DiscordAutoModerationRule, DiscordBan, DiscordBulkBan, DiscordChannel, DiscordConnection, DiscordCurrentAuthorization, DiscordEmoji, DiscordEntitlement, DiscordFollowedChannel, DiscordGetAnswerVotesResponse, DiscordGetChannelPins, DiscordGetGatewayBot, DiscordGuild, DiscordGuildApplicationCommandPermissions, DiscordGuildOnboarding, DiscordGuildPreview, DiscordGuildWidget, DiscordGuildWidgetSettings, DiscordIncidentsData, DiscordIntegration, DiscordInteractionCallbackResponse, DiscordInvite, DiscordInviteMetadata, DiscordListActiveThreads, DiscordListArchivedThreads, DiscordLobby, DiscordLobbyInvite, DiscordLobbyMember, DiscordLobbyMessage, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordPrunedCount, DiscordRole, DiscordScheduledEvent, DiscordSearchGuildMessages, DiscordSearchGuildMessagesIndexing, DiscordSku, DiscordSoundboardSound, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordSubscription, DiscordTargetUsersJobStatus, DiscordTemplate, DiscordThreadMember, DiscordTokenExchange, DiscordTokenRevocation, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordVoiceState, DiscordWebhook, DiscordWelcomeScreen, EditApplication, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildOnboarding, EditGuildRole, EditGuildStickerOptions, EditMessage, EditOwnVoiceState, EditScheduledEvent, EditUserVoiceState, EditWebhookMessageOptions, ExecuteWebhook, FileContent, GetApplicationCommandPermissionOptions, GetBans, GetChannelPinsOptions, GetEntitlements, GetGlobalApplicationCommandsOptions, GetGuildApplicationCommandsOptions, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetLobbyMessages, GetMessagesOptions, GetPollAnswerVotes, GetReactions, GetScheduledEvents, GetScheduledEventUsers, GetThreadMember, GetUserGuilds, GetWebhookMessageOptions, InteractionCallbackData, InteractionCallbackOptions, InteractionResponse, LinkChannelToLobby, ListArchivedThreads, ListGuildMembers, ListSkuSubscriptionsOptions, ListThreadMembers, ModifyApplicationEmoji, ModifyChannel, ModifyCurrentMember, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyGuildIncidentActions, ModifyGuildMember, ModifyGuildSoundboardSound, ModifyGuildTemplate, ModifyGuildWelcomeScreen, ModifyLobby, ModifyRolePositions, ModifyWebhook, SearchGuildMessagesOptions, SearchMembers, SendLobbyMessage, SendSoundboardSound, StartThreadWithMessage, StartThreadWithoutMessage, UpsertGlobalApplicationCommandOptions, UpsertGuildApplicationCommandOptions } from '@discordeno/types';
1
+ import type { BigString, FileContent } from '@discordeno/types';
2
2
  import type { logger } from '@discordeno/utils';
3
+ import type { CamelizedRestEndpoints, RestEndpoints } from './endpoints.js';
3
4
  import type { InvalidRequestBucket } from './invalidBucket.js';
4
5
  import type { Queue } from './queue.js';
5
6
  import type { RestRoutes } from './typings/routes.js';
@@ -94,7 +95,7 @@ export interface CreateRestManagerOptions {
94
95
  */
95
96
  requestTimeout?: number;
96
97
  }
97
- export interface RestManager {
98
+ export interface RestManager extends CamelizedRestEndpoints {
98
99
  /** The bot token which will be used to make requests. */
99
100
  token: string;
100
101
  /** The application id. Normally this is not required for recent bots but old bot's application id is sometimes different from the bot id so it is required for those bots. */
@@ -148,6 +149,26 @@ export interface RestManager {
148
149
  * Only used when {@link RestManager.retryProxiedRequests} is enabled.
149
150
  */
150
151
  proxyRetryDelayStep: number;
152
+ /**
153
+ * The maximum amount of times a request should be re-sent after a server error. Defaults to 3.
154
+ *
155
+ * @remarks
156
+ * Only the statuses in `RETRYABLE_SERVER_ERRORS` are re-sent, the ones a gateway in front of the api answers with rather than the api
157
+ * itself.
158
+ *
159
+ * This has its own limit because {@link RestManager.maxRetryCount} is Infinity by default, which would keep every request alive for as
160
+ * long as a Discord outage lasts.
161
+ *
162
+ * Whichever of the two is lower applies.
163
+ */
164
+ maxServerErrorRetryCount: number;
165
+ /**
166
+ * How much longer to wait before each further re-send after a server error, in milliseconds. Defaults to 1000.
167
+ *
168
+ * @remarks
169
+ * Discord sends no `retry-after` with a server error, so the nth attempt waits n times this (1s, then 2s, then 3s, ...) instead.
170
+ */
171
+ serverErrorRetryDelayStep: number;
151
172
  /** The maximum time in milliseconds a single request attempt may take before it is aborted. Timed-out attempts are only retried when talking to Discord directly, or through a proxy when `retryProxiedRequests` is enabled. Defaults to 30000 (30 seconds). Set to 0 to disable. */
152
173
  requestTimeout: number;
153
174
  /** Whether or not the manager is rate limited globally across all requests. Defaults to false. */
@@ -170,8 +191,6 @@ export interface RestManager {
170
191
  events: RestManagerEvents;
171
192
  /** Allows the user to inject custom headers that will be sent with every request. */
172
193
  createBaseHeaders: () => Record<string, string>;
173
- /** Whether or not the rest manager should keep objects in raw snake case from discord. */
174
- preferSnakeCase: (enabled: boolean) => RestManager;
175
194
  /** Check the rate limits for a url or a bucket. */
176
195
  checkRateLimits: (url: string, identifier: string) => number | false;
177
196
  updateTokenQueues: (oldToken: string, newToken: string) => Promise<void>;
@@ -194,3090 +213,67 @@ export interface RestManager {
194
213
  /** Takes a request and processes it into a queue. */
195
214
  processRequest: (request: SendRequestOptions) => Promise<void>;
196
215
  /** Make a get request to the api */
197
- get: <T = void>(url: string, options?: Omit<MakeRequestOptions, 'body'>) => Promise<Camelize<T>>;
216
+ get: <T = void>(url: string, options?: Omit<MakeRequestOptions, 'body'>) => Promise<T>;
198
217
  /** Make a post request to the api. */
199
- post: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
218
+ post: <T = void>(url: string, options?: MakeRequestOptions) => Promise<T>;
200
219
  /** Make a put request to the api. */
201
- put: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
220
+ put: <T = void>(url: string, options?: MakeRequestOptions) => Promise<T>;
202
221
  /** Make a delete request to the api. */
203
222
  delete: (url: string, options?: Omit<MakeRequestOptions, 'body'>) => Promise<void>;
204
223
  /** Make a patch request to the api. */
205
- patch: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
206
- /**
207
- * Adds a reaction to a message.
208
- *
209
- * @param channelId - The ID of the channel the message to add a reaction to is in.
210
- * @param messageId - The ID of the message to add a reaction to.
211
- * @param reaction - The reaction to add to the message.
212
- * @returns
213
- *
214
- * @remarks
215
- * Requires the `READ_MESSAGE_HISTORY` permission.
216
- *
217
- * If nobody else has reacted to the message:
218
- * - Requires the `ADD_REACTIONS` permission.
219
- *
220
- * Fires a _Message Reaction Add_ gateway event.
221
- *
222
- * @see {@link https://docs.discord.com/developers/resources/channel#create-reaction}
223
- */
224
- addReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
225
- /**
226
- * Adds multiple a reaction to a message.
227
- *
228
- * This function uses the `addReaction()` helper behind the scenes.
229
- *
230
- * @param channelId - The ID of the channel the message to add reactions to is in.
231
- * @param messageId - The ID of the message to add the reactions to.
232
- * @param reactions - The reactions to add to the message.
233
- * @param ordered - Whether the reactions must be added in order or not.
234
- *
235
- * @remarks
236
- * Requires the `READ_MESSAGE_HISTORY` permission.
237
- *
238
- * If nobody else has reacted to the message:
239
- * - Requires the `ADD_REACTIONS` permission.
240
- *
241
- * Fires a _Message Reaction Add_ gateway event for every reaction added.
242
- */
243
- addReactions: (channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean) => Promise<void>;
244
- /**
245
- * Adds a role to a member.
246
- *
247
- * @param guildId - The ID of the guild the member to add the role to is in.
248
- * @param userId - The user ID of the member to add the role to.
249
- * @param roleId - The ID of the role to add to the member.
250
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
251
- *
252
- * @remarks
253
- * Requires the `MANAGE_ROLES` permission.
254
- *
255
- * Fires a _Guild Member Update_ gateway event.
256
- *
257
- * @see {@link https://docs.discord.com/developers/resources/guild#add-guild-member-role}
258
- */
259
- addRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
260
- /**
261
- * Adds a member to a thread.
262
- *
263
- * @param channelId - The ID of the thread to add the member to.
264
- * @param userId - The user ID of the member to add to the thread.
265
- *
266
- * @remarks
267
- * Requires the ability to send messages in the thread.
268
- * Requires the thread not be archived.
269
- *
270
- * Fires a _Thread Members Update_ gateway event.
271
- *
272
- * @see {@link https://docs.discord.com/developers/resources/channel#add-thread-member}
273
- */
274
- addThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
275
- /**
276
- * Adds a recipient to a group DM.
277
- *
278
- * @param channelId - The ID of the group dm to add the user to.
279
- * @param userId - The user ID of the user to add to the group dm.
280
- * @param options - The options for adding the user
281
- *
282
- * @remarks
283
- * Requires an OAuth2 access token with the `gdm.join` scope
284
- *
285
- * @see {@link https://docs.discord.com/developers/resources/channel#group-dm-add-recipient}
286
- */
287
- addDmRecipient: (channelId: BigString, userId: BigString, options: AddDmRecipientOptions) => Promise<void>;
288
- /**
289
- * Adds a member to a guild.
290
- *
291
- * @param guildId - The ID of the thread to add the member to.
292
- * @param userId - The user ID of the member to add to the thread.
293
- * @param options - The options for the add of a guild member
294
- *
295
- * @remarks
296
- * Requires the bot to be in the specified server
297
- * Requires an OAuth2 access token with the `guilds.join` scope
298
- *
299
- * Fires a _Guild Member Add_ gateway event.
300
- *
301
- * @see {@link https://docs.discord.com/developers/resources/guild#add-guild-member}
302
- */
303
- addGuildMember: (guildId: BigString, userId: BigString, options: AddGuildMemberOptions) => Promise<void>;
304
- /**
305
- * Creates an automod rule in a guild.
306
- *
307
- * @param guildId - The ID of the guild to create the rule in.
308
- * @param options - The parameters for the creation of the rule.
309
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
310
- * @returns An instance of the created {@link DiscordAutoModerationRule}.
311
- *
312
- * @remarks
313
- * Requires the `MANAGE_GUILD` permission.
314
- *
315
- * Fires an _Auto Moderation Rule Create_ gateway event.
316
- *
317
- * @see {@link https://docs.discord.com/developers/resources/auto-moderation#create-auto-moderation-rule}
318
- */
319
- createAutomodRule: (guildId: BigString, options: CreateAutoModerationRuleOptions, reason?: string) => Promise<Camelize<DiscordAutoModerationRule>>;
320
- /**
321
- * Creates a channel within a guild.
322
- *
323
- * @param guildId - The ID of the guild to create the channel within.
324
- * @param options - The parameters for the creation of the channel.
325
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
326
- * @returns An instance of the created {@link DiscordChannel}.
327
- *
328
- * @remarks
329
- * Requires the `MANAGE_CHANNELS` permission.
330
- *
331
- * If setting permission overwrites, only the permissions the bot user has in the guild can be allowed or denied.
332
- *
333
- * Setting the `MANAGE_ROLES` permission is only possible for guild administrators.
334
- *
335
- * Fires a _Channel Create_ gateway event.
336
- *
337
- * @see {@link https://docs.discord.com/developers/resources/guild#create-guild-channel}
338
- */
339
- createChannel: (guildId: BigString, options: CreateGuildChannel, reason?: string) => Promise<Camelize<DiscordChannel>>;
340
- /**
341
- * Creates an emoji in a guild.
342
- *
343
- * @param guildId - The ID of the guild in which to create the emoji.
344
- * @param options - The parameters for the creation of the emoji.
345
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
346
- * @returns An instance of the created {@link DiscordEmoji}.
347
- *
348
- * @remarks
349
- * Requires the `CREATE_GUILD_EXPRESSIONS` permission.
350
- *
351
- * Emojis have a maximum file size of 256 kilobits. Attempting to upload a larger emoji will cause the route to return 400 Bad Request.
352
- *
353
- * Fires a _Guild Emojis Update_ gateway event.
354
- *
355
- * @see {@link https://docs.discord.com/developers/resources/emoji#create-guild-emoji}
356
- */
357
- createEmoji: (guildId: BigString, options: CreateGuildEmoji, reason?: string) => Promise<Camelize<DiscordEmoji>>;
358
- /**
359
- * Creates an emoji for the application.
360
- *
361
- * @param options - The parameters for the creation of the emoji.
362
- * @returns An instance of the created {@link DiscordEmoji}.
363
- *
364
- * @see {@link https://docs.discord.com/developers/resources/emoji#create-application-emoji}
365
- */
366
- createApplicationEmoji: (options: CreateApplicationEmoji) => Promise<Camelize<DiscordEmoji>>;
367
- /**
368
- * Creates a new thread in a forum channel or media channel, and sends a message within the created thread.
369
- *
370
- * @param channelId - The ID of the forum channel to create the thread within.
371
- * @param options - The parameters for the creation of the thread.
372
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
373
- * @returns An instance of {@link DiscordChannel} with a nested {@link DiscordChannel} object.
374
- *
375
- * @remarks
376
- * Requires the `CREATE_MESSAGES` permission.
377
- *
378
- * Fires a _Thread Create_ gateway event.
379
- * Fires a _Message Create_ gateway event.
380
- *
381
- * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel}
382
- */
383
- createForumThread: (channelId: BigString, options: CreateForumPostWithMessage, reason?: string) => Promise<Camelize<DiscordChannel>>;
384
- /**
385
- * Creates an application command accessible globally; across different guilds and channels.
386
- *
387
- * @param command - The command to create.
388
- * @param options - Additional options for the endpoint
389
- * @returns An instance of the created {@link DiscordApplicationCommand}.
390
- *
391
- * @remarks
392
- * ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
393
- * ⚠️ Global commands once created are cached for periods of __an hour__, so changes made to existing commands will take an hour to surface.
394
- * ⚠️ You can only create up to 200 _new_ commands daily.
395
- *
396
- * When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
397
- * You will be able to update only your own application commands
398
- *
399
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#create-global-application-command}
400
- */
401
- createGlobalApplicationCommand: (command: CreateApplicationCommand, options?: CreateGlobalApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>>;
402
- /**
403
- * Creates an application command only accessible in a specific guild.
404
- *
405
- * @param command - The command to create.
406
- * @param guildId - The ID of the guild to create the command for.
407
- * @param options - Additional options for the endpoint
408
- * @returns An instance of the created {@link DiscordApplicationCommand}.
409
- *
410
- * @remarks
411
- * ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
412
- * ⚠️ You can only create up to 200 _new_ commands daily.
413
- *
414
- * When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
415
- * You will be able to update only your own application commands
416
- *
417
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#create-guild-application-command}
418
- */
419
- createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString, options?: CreateGuildApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>>;
420
- /**
421
- * Create a new sticker for the guild.
422
- *
423
- * @param guildId The ID of the guild to get
424
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
425
- * @return A {@link DiscordSticker}
426
- *
427
- * @remarks
428
- * Requires the `CREATE_GUILD_EXPRESSIONS` permission.
429
- * Fires a Guild Stickers Update Gateway event.
430
- * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
431
- * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
432
- *
433
- * @see {@link https://docs.discord.com/developers/resources/sticker#create-guild-sticker}
434
- */
435
- createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions, reason?: string) => Promise<Camelize<DiscordSticker>>;
436
- /**
437
- * Creates a template from a guild.
438
- *
439
- * @param guildId - The ID of the guild to create the template from.
440
- * @param options - The parameters for the creation of the template.
441
- * @returns An instance of the created {@link DiscordTemplate}.
442
- *
443
- * @remarks
444
- * Requires the `MANAGE_GUILD` permission.
445
- *
446
- * Fires a _Guild Update_ gateway event.
447
- *
448
- * @see {@link https://docs.discord.com/developers/resources/guild-template#create-guild-template}
449
- */
450
- createGuildTemplate: (guildId: BigString, options: CreateTemplate) => Promise<Camelize<DiscordTemplate>>;
451
- /**
452
- * Creates an invite to a channel in a guild.
453
- *
454
- * @param channelId - The ID of the channel to create the invite to.
455
- * @param options - The parameters for the creation of the invite.
456
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
457
- * @returns An instance of the created {@link DiscordInvite}.
458
- *
459
- * @remarks
460
- * Requires the `CREATE_INSTANT_INVITE` permission.
461
- *
462
- * Fires an _Invite Create_ gateway event.
463
- *
464
- * @privateRemarks
465
- * The request body is not optional, and an empty JSON object must be sent regardless of whether any fields are being transmitted.
466
- *
467
- * @see {@link https://docs.discord.com/developers/resources/channel#create-channel-invite}
468
- */
469
- createInvite: (channelId: BigString, options?: CreateChannelInvite, reason?: string) => Promise<Camelize<DiscordInvite>>;
470
- /**
471
- * Get guild role member counts
472
- *
473
- * Returns a map of role IDs to the number of members with the role. Does not include the \@everyone role.
474
- *
475
- * @param guildId - The ID of the guild to get role member counts for.
476
- *
477
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role-member-counts}
478
- */
479
- getGuildRoleMemberCounts: (guildId: BigString) => Promise<Record<string, number>>;
480
- /**
481
- * Creates a role in a guild.
482
- *
483
- * @param guildId - The ID of the guild to create the role in.
484
- * @param options - The parameters for the creation of the role.
485
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
486
- * @returns An instance of the created {@link DiscordRole}.
487
- *
488
- * @remarks
489
- * Requires the `MANAGE_ROLES` permission.
490
- *
491
- * Fires a _Guild Role Create_ gateway event.
492
- *
493
- * @see {@link https://docs.discord.com/developers/resources/guild#create-guild-role}
494
- */
495
- createRole: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
496
- /**
497
- * Creates a scheduled event in a guild.
498
- *
499
- * @param guildId - The ID of the guild to create the scheduled event in.
500
- * @param options - The parameters for the creation of the scheduled event.
501
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
502
- * @returns An instance of the created {@link DiscordScheduledEvent}.
503
- *
504
- * @remarks
505
- * Requires the `MANAGE_EVENTS` permission.
506
- *
507
- * A guild can only have a maximum of 100 events with a status of {@link ScheduledEventStatus}.Active or {@link ScheduledEventStatus}.Scheduled (inclusive).
508
- *
509
- * Fires a _Guild Scheduled Event Create_ gateway event.
510
- *
511
- * @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#create-guild-scheduled-event}
512
- */
513
- createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent, reason?: string) => Promise<Camelize<DiscordScheduledEvent>>;
514
- /**
515
- * Creates a stage instance associated with a stage channel.
516
- *
517
- * @param options - The parameters for the creation of the stage instance.
518
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
519
- * @returns An instance of the created {@link DiscordStageInstance}.
520
- *
521
- * @remarks
522
- * Requires the user to be a moderator of the stage channel.
523
- *
524
- * Fires a _Stage Instance Create_ gateway event.
525
- *
526
- * @see {@link https://docs.discord.com/developers/resources/stage-instance#create-stage-instance}
527
- */
528
- createStageInstance: (options: CreateStageInstance, reason?: string) => Promise<Camelize<DiscordStageInstance>>;
529
- /**
530
- * Creates a webhook.
531
- *
532
- * @param channelId - The ID of the channel to create the webhook in.
533
- * @param options - The parameters for the creation of the webhook.
534
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
535
- * @returns An instance of the created {@link DiscordWebhook}.
536
- *
537
- * @remarks
538
- * Requires the `MANAGE_WEBHOOKS` permission.
539
- *
540
- * ⚠️ The webhook name must not contain the substrings 'clyde', or 'discord' (case-insensitive).
541
- *
542
- * Fires a _Webhooks Update_ gateway event.
543
- *
544
- * @see {@link https://docs.discord.com/developers/resources/webhook#create-webhook}
545
- */
546
- createWebhook: (channelId: BigString, options: CreateWebhook, reason?: string) => Promise<Camelize<DiscordWebhook>>;
547
- /**
548
- * Deletes an automod rule.
549
- *
550
- * @param guildId - The ID of the guild to delete the rule from.
551
- * @param ruleId - The ID of the automod rule to delete.
552
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
553
- *
554
- * @remarks
555
- * Requires the `MANAGE_GUILD` permission.
556
- *
557
- * Fires an _Auto Moderation Rule Delete_ gateway event.
558
- *
559
- * @see {@link https://docs.discord.com/developers/resources/auto-moderation#delete-auto-moderation-rule}
560
- */
561
- deleteAutomodRule: (guildId: BigString, ruleId: BigString, reason?: string) => Promise<void>;
562
- /**
563
- * Deletes a channel from within a guild.
564
- *
565
- * @param channelId - The ID of the channel to delete.
566
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
567
- * @returns nothing
568
- *
569
- * @remarks
570
- * For community guilds, the _Rules_, _Guidelines_ and _Community Update_ channels cannot be deleted.
571
- *
572
- * If the channel is a thread:
573
- * - Requires the `MANAGE_THREADS` permission.
574
- *
575
- * - Fires a _Thread Delete_ gateway event.
576
- *
577
- * Otherwise:
578
- * - Requires the `MANAGE_CHANNELS` permission.
579
- *
580
- * - ⚠️ Deleting a category channel does not delete its child channels.
581
- * Instead, they will have their `parent_id` property removed, and a `Channel Update` gateway event will fire for each of them.
582
- *
583
- * - Fires a _Channel Delete_ gateway event.
584
- *
585
- * @see {@link https://docs.discord.com/developers/resources/channel#deleteclose-channel}
586
- */
587
- deleteChannel: (channelId: BigString, reason?: string) => Promise<void>;
588
- /**
589
- * Deletes a permission override for a user or role in a channel.
590
- *
591
- * @param channelId - The ID of the channel to delete the permission override of.
592
- * @param overwriteId - The ID of the permission override to delete.
593
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
594
- *
595
- * @remarks
596
- * Requires the `MANAGE_ROLES` permission.
597
- *
598
- * Fires a _Channel Update_ gateway event.
599
- *
600
- * @see {@link https://docs.discord.com/developers/resources/channel#delete-channel-permission}
601
- */
602
- deleteChannelPermissionOverride: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise<void>;
603
- /**
604
- * Deletes an emoji from a guild.
605
- *
606
- * @param guildId - The ID of the guild from which to delete the emoji.
607
- * @param id - The ID of the emoji to delete.
608
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
609
- *
610
- * @remarks
611
- * For emojis created by the current user, requires either the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
612
- * For other emojis, requires the `MANAGE_GUILD_EXPRESSIONS` permission.
613
- *
614
- * Fires a _Guild Emojis Update_ gateway event.
615
- *
616
- * @see {@link https://docs.discord.com/developers/resources/emoji#delete-guild-emoji}
617
- */
618
- deleteEmoji: (guildId: BigString, id: BigString, reason?: string) => Promise<void>;
619
- /**
620
- * Deletes an emoji from the application.
621
- *
622
- * @param id - The ID of the emoji to delete.
623
- *
624
- * @see {@link https://docs.discord.com/developers/resources/emoji#delete-application-emoji}
625
- */
626
- deleteApplicationEmoji: (id: BigString) => Promise<void>;
627
- /**
628
- * Deletes a follow-up message to an interaction.
629
- *
630
- * @param token - The interaction token to use, provided in the original interaction.
631
- * @param messageId - The ID of the message to delete.
632
- *
633
- * @remarks
634
- * Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
635
- *
636
- * Fires a _Message Delete_ event.
637
- *
638
- * @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#delete-followup-message}
639
- */
640
- deleteFollowupMessage: (token: string, messageId: BigString) => Promise<void>;
641
- /**
642
- * Deletes an application command registered globally.
643
- *
644
- * @param commandId - The ID of the command to delete.
645
- *
646
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#delete-global-application-command}
647
- */
648
- deleteGlobalApplicationCommand: (commandId: BigString) => Promise<void>;
649
- /**
650
- * Deletes an application command registered in a guild.
651
- *
652
- * @param guildId - The ID of the guild to delete the command from.
653
- * @param commandId - The ID of the command to delete from the guild.
654
- *
655
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#delete-guild-application-command}
656
- */
657
- deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
224
+ patch: <T = void>(url: string, options?: MakeRequestOptions) => Promise<T>;
225
+ /** The functions to call the endpoints but without the response body being camelized. */
226
+ snake: RestEndpoints;
227
+ }
228
+ export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
229
+ export type ApiVersions = 9 | 10;
230
+ export interface CreateRequestBodyOptions {
231
+ headers?: Record<string, string>;
232
+ body?: any;
233
+ unauthorized?: boolean;
234
+ reason?: string;
235
+ files?: FileContent[];
658
236
  /**
659
- * Delete a new sticker for the guild.
660
- *
661
- * @param guildId The ID of the guild to get
662
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
663
- * @return A {@link DiscordSticker}
237
+ * An `AbortSignal` to cancel the request.
664
238
  *
665
239
  * @remarks
666
- * For stickers created by the current user, requires either the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
667
- * For other stickers, requires the `MANAGE_GUILD_EXPRESSIONS` permission.
668
- * Fires a Guild Stickers Update Gateway event.
669
- * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
670
- * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
671
- *
672
- * @see {@link https://docs.discord.com/developers/resources/sticker#delete-guild-sticker}
240
+ * Aborting rejects a request that is still waiting in the queue right away and guarantees it is never sent.
241
+ * An attempt that is already in flight gets its connection cancelled as well, though that cannot recall it:
242
+ * Discord (or the proxy) may have received it and may still process it, only the response is discarded.
243
+ * This lets a rest proxy drop requests that nobody is waiting on anymore (client disconnect, deadline)
244
+ * instead of leaving them in the queue.
673
245
  */
674
- deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
246
+ signal?: AbortSignal;
247
+ }
248
+ export type MakeRequestOptions = Omit<CreateRequestBodyOptions, 'method'> & Pick<SendRequestOptions, 'runThroughQueue'>;
249
+ export interface RequestBody {
250
+ headers: Record<string, string>;
251
+ body?: string | FormData;
252
+ method: RequestMethods;
253
+ }
254
+ export interface SendRequestOptions {
255
+ /** The route to send the request to. */
256
+ route: string;
257
+ /** The method to use for sending the request. */
258
+ method: RequestMethods;
259
+ /** The amount of times this request has been retried. */
260
+ retryCount: number;
261
+ /** Handler to retry a request should it be rate limited. */
262
+ retryRequest?: (options: SendRequestOptions) => Promise<void>;
263
+ /** Resolve handler when a request succeeds. */
264
+ resolve: (value: RestRequestResponse) => void;
265
+ /** Reject handler when a request fails. */
266
+ reject: (value: RestRequestRejection) => void;
267
+ /** If this request has a bucket id which it falls under for rate limit */
268
+ bucketId?: string;
675
269
  /**
676
- * Deletes a template from a guild.
677
- *
678
- * @param guildId - The ID of the guild to delete the template from.
679
- * @param templateCode - The code of the template to delete.
270
+ * The simplified url of this request, as `rest.simplifyUrl` returned it when the request was first handled.
680
271
  *
681
272
  * @remarks
682
- * Requires the `MANAGE_GUILD` permission.
683
- *
684
- * Fires a _Guild Update_ gateway event.
685
- *
686
- * @see {@link https://docs.discord.com/developers/resources/guild-template#delete-guild-template}
273
+ * The simplified url of a message delete depends on how old the message is, so it has to be kept instead of being worked out again later,
274
+ * or the key the queue was found under and the key its response is credited to stop matching once the message crosses one of those ages.
687
275
  */
688
- deleteGuildTemplate: (guildId: BigString, templateCode: string) => Promise<void>;
689
- /**
690
- * Deletes an integration attached to a guild.
691
- *
692
- * @param guildId - The ID of the guild from which to delete the integration.
693
- * @param integrationId - The ID of the integration to delete from the guild.
694
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
695
- *
696
- * @remarks
697
- * Requires the `MANAGE_GUILD` permission.
698
- *
699
- * Deletes all webhooks associated with the integration, and kicks the associated bot if there is one.
700
- *
701
- * Fires a _Guild Integrations Update_ gateway event.
702
- * Fires a _Integration Delete_ gateway event.
703
- *
704
- * @see {@link https://docs.discord.com/developers/resources/guild#delete-guild-integration}
705
- */
706
- deleteIntegration: (guildId: BigString, integrationId: BigString, reason?: string) => Promise<void>;
707
- /**
708
- * Deletes an invite to a channel.
709
- *
710
- * @param inviteCode - The invite code of the invite to delete.
711
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
712
- *
713
- * @remarks
714
- * Requires the `MANAGE_CHANNELS` permission.
715
- *
716
- * Fires an _Invite Delete_ gateway event.
717
- *
718
- * @see {@link https://docs.discord.com/developers/resources/channel#delete-channel-invite}
719
- */
720
- deleteInvite: (inviteCode: string, reason?: string) => Promise<void>;
721
- /**
722
- * Gets the users allowed to see and accept this invite.
723
- *
724
- * @param inviteCode - The invite code of the invite to update.
725
- * @returns CSV file containing the user IDs with the header `user_id` and each user ID from the original file
726
- *
727
- * @remarks
728
- * Requires called to be the inviter, or have `MANAGE_GUILD` permission, or have `VIEW_AUDIT_LOG` permission.
729
- *
730
- * @see {@link https://docs.discord.com/developers/resources/invite#get-target-users}
731
- */
732
- getTargetUsers: (inviteCode: string) => Promise<string>;
733
- /**
734
- * Updates the users allowed to see and accept this invite.
735
- *
736
- * @param inviteCode - The invite code of the invite to update.
737
- * @param targetUsersFile - A CSV file with a single column of user IDs for all the users able to accept this invite
738
- *
739
- * @remarks
740
- * Requires the caller to be the inviter or have the `MANAGE_GUILD` permission.
741
- *
742
- * Uploading a file with invalid user IDs will result in a 400 with the invalid IDs described.
743
- *
744
- * @see {@link https://docs.discord.com/developers/resources/invite#update-target-users}
745
- */
746
- updateTargetUsers: (inviteCode: string, targetUsersFile: Blob) => Promise<void>;
747
- /**
748
- * Processing target users from a CSV when creating or updating an invite is done asynchronously. This endpoint allows you to check the status of that job.
749
- *
750
- * @param inviteCode - The invite code of the invite to check the target users job status for.
751
- * @returns An object containing the status of the target users job.
752
- *
753
- * @remarks
754
- * Requires the caller to be the inviter, or have `MANAGE_GUILD` permission, or have `VIEW_AUDIT_LOG` permission.
755
- *
756
- * @see {@link https://docs.discord.com/developers/resources/invite#get-target-users-job-status}
757
- */
758
- getTargetUsersJobStatus: (inviteCode: string) => Promise<Camelize<DiscordTargetUsersJobStatus>>;
759
- /**
760
- * Deletes a message from a channel.
761
- *
762
- * @param channelId - The ID of the channel to delete the message from.
763
- * @param messageId - The ID of the message to delete from the channel.
764
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
765
- *
766
- * @remarks
767
- * If not deleting own message:
768
- * - Requires the `MANAGE_MESSAGES` permission.
769
- *
770
- * Fires a _Message Delete_ gateway event.
771
- *
772
- * @see {@link https://docs.discord.com/developers/resources/channel#delete-message}
773
- */
774
- deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
775
- /**
776
- * Deletes multiple messages from a channel.
777
- *
778
- * @param channelId - The ID of the channel to delete the messages from.
779
- * @param messageIds - The IDs of the messages to delete from the channel.
780
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
781
- *
782
- * @remarks
783
- * Requires the `MANAGE_MESSAGES` permission.
784
- *
785
- * ⚠️ Messages older than 2 weeks old cannot be deleted.
786
- *
787
- * Fires a _Message Delete Bulk_ gateway event.
788
- *
789
- * @see {@link https://docs.discord.com/developers/resources/channel#bulk-delete-messages}
790
- */
791
- deleteMessages: (channelId: BigString, messageIds: BigString[], reason?: string) => Promise<void>;
792
- /**
793
- * Deletes the initial message response to an interaction.
794
- *
795
- * @param token - The interaction token to use, provided in the original interaction.
796
- *
797
- * @remarks
798
- * Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
799
- *
800
- * Fires a _Message Delete_ event.
801
- *
802
- * @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#delete-original-interaction-response}
803
- */
804
- deleteOriginalInteractionResponse: (token: string) => Promise<void>;
805
- /**
806
- * Deletes a reaction added by the bot user from a message.
807
- *
808
- * @param channelId - The ID of the channel the message to delete the reaction from is in.
809
- * @param messageId - The ID of the message to delete the reaction from.
810
- * @param reaction - The reaction to delete from the message.
811
- *
812
- * @remarks
813
- * Requires the `READ_MESSAGE_HISTORY` permission.
814
- *
815
- * Fires a _Message Reaction Remove_ gateway event.
816
- *
817
- * @see {@link https://docs.discord.com/developers/resources/channel#delete-own-reaction}
818
- */
819
- deleteOwnReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
820
- /**
821
- * Deletes all reactions for all emojis from a message.
822
- *
823
- * @param channelId - The ID of the channel the message to delete the reactions from is in.
824
- * @param messageId - The ID of the message to delete the reactions from.
825
- *
826
- * @remarks
827
- * Requires the `READ_MESSAGE_HISTORY` permission.
828
- *
829
- * Requires the `MANAGE_MESSAGES` permission.
830
- *
831
- * Fires a _Message Reaction Remove All_ gateway event.
832
- *
833
- * @see {@link https://docs.discord.com/developers/resources/channel#delete-all-reactions}
834
- */
835
- deleteReactionsAll: (channelId: BigString, messageId: BigString) => Promise<void>;
836
- /**
837
- * Deletes all reactions for an emoji from a message.
838
- *
839
- * @param channelId - The ID of the channel the message to delete the reactions from is in.
840
- * @param messageId - The ID of the message to delete the reactions from.
841
- * @param reaction - The reaction to remove from the message.
842
- *
843
- * @remarks
844
- * Requires the `READ_MESSAGE_HISTORY` permission.
845
- *
846
- * Requires the `MANAGE_MESSAGES` permission.
847
- *
848
- * Fires a _Message Reaction Remove Emoji_ gateway event.
849
- *
850
- * @see {@link https://docs.discord.com/developers/resources/channel#delete-all-reactions-for-emoji}
851
- */
852
- deleteReactionsEmoji: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
853
- /**
854
- * Deletes a role from a guild.
855
- *
856
- * @param guildId - The ID of the guild to delete the role from.
857
- * @param roleId - The ID of the role to delete.
858
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
859
- *
860
- * @remarks
861
- * Requires the `MANAGE_ROLES` permission.
862
- *
863
- * Fires a _Guild Role Delete_ gateway event.
864
- *
865
- * @see {@link https://docs.discord.com/developers/resources/guild#delete-guild-role}
866
- */
867
- deleteRole: (guildId: BigString, roleId: BigString, reason?: string) => Promise<void>;
868
- /**
869
- * Deletes a scheduled event from a guild.
870
- *
871
- * @param guildId - The ID of the guild to delete the scheduled event from.
872
- * @param eventId - The ID of the scheduled event to delete.
873
- *
874
- * @remarks
875
- * Requires the `MANAGE_EVENTS` permission.
876
- *
877
- * Fires a _Guild Scheduled Event Delete_ gateway event.
878
- *
879
- * @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#delete-guild-scheduled-event}
880
- */
881
- deleteScheduledEvent: (guildId: BigString, eventId: BigString) => Promise<void>;
882
- /**
883
- * Deletes the stage instance associated with a stage channel, if one exists.
884
- *
885
- * @param channelId - The ID of the stage channel the stage instance is associated with.
886
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
887
- *
888
- * @remarks
889
- * Requires the user to be a moderator of the stage channel.
890
- *
891
- * Fires a _Stage Instance Delete_ gateway event.
892
- *
893
- * @see {@link https://docs.discord.com/developers/resources/stage-instance#delete-stage-instance}
894
- */
895
- deleteStageInstance: (channelId: BigString, reason?: string) => Promise<void>;
896
- /**
897
- * Deletes a user's reaction from a message.
898
- *
899
- * @param channelId - The ID of the channel the message to delete the reaction from is in.
900
- * @param messageId - The ID of the message to delete the reaction from.
901
- * @param userId - The ID of the user whose reaction to delete.
902
- * @param reaction - The reaction to delete from the message.
903
- *
904
- * @remarks
905
- * Requires the `READ_MESSAGE_HISTORY` permission.
906
- *
907
- * Requires the `MANAGE_MESSAGES` permission.
908
- *
909
- * Fires a _Message Reaction Remove_ gateway event.
910
- *
911
- * @see {@link https://docs.discord.com/developers/resources/channel#delete-user-reaction}
912
- */
913
- deleteUserReaction: (channelId: BigString, messageId: BigString, userId: BigString, reaction: string) => Promise<void>;
914
- /**
915
- * Deletes a webhook.
916
- *
917
- * @param webhookId - The ID of the webhook to delete.
918
- *
919
- * @remarks
920
- * Requires the `MANAGE_WEBHOOKS` permission.
921
- *
922
- * Fires a _Webhooks Update_ gateway event.
923
- *
924
- * @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook}
925
- */
926
- deleteWebhook: (webhookId: BigString, reason?: string) => Promise<void>;
927
- /**
928
- * Deletes a webhook message.
929
- *
930
- * @param webhookId - The ID of the webhook to delete the message belonging to.
931
- * @param token - The webhook token, used to manage the webhook.
932
- * @param messageId - The ID of the message to delete.
933
- * @param options - The parameters for the deletion of the message.
934
- *
935
- * @remarks
936
- * Fires a _Message Delete_ gateway event.
937
- *
938
- * @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook}
939
- */
940
- deleteWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise<void>;
941
- /**
942
- * Deletes a webhook message using the webhook token, thereby bypassing the need for authentication + permissions.
943
- *
944
- * @param webhookId - The ID of the webhook to delete the message belonging to.
945
- * @param token - The webhook token, used to delete the webhook.
946
- *
947
- * @remarks
948
- * Fires a _Message Delete_ gateway event.
949
- *
950
- * @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook-with-token}
951
- */
952
- deleteWebhookWithToken: (webhookId: BigString, token: string) => Promise<void>;
953
- /**
954
- * Edits the permissions for a guild application command.
955
- *
956
- * @param guildId - The ID of the guild the command is registered in.
957
- * @param commandId - The ID of the command to edit the permissions of.
958
- * @param bearerToken - The bearer token to use to make the request.
959
- * @param options - The parameters for the edit of the command permissions.
960
- * @returns An instance of the edited {@link DiscordGuildApplicationCommandPermissions}.
961
- *
962
- * @remarks
963
- * The bearer token requires the `applications.commands.permissions.update` scope to be enabled, and to have access to the guild whose ID has been provided in the parameters.
964
- *
965
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-application-command-permissions}
966
- */
967
- editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: Camelize<DiscordApplicationCommandPermissions>[]) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>>;
968
- /**
969
- * Edits an automod rule.
970
- *
971
- * @param guildId - The ID of the guild to edit the rule in.
972
- * @param ruleId - The ID of the rule to edit.
973
- * @param options - The parameters for the edit of the rule.
974
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
975
- * @returns An instance of the edited {@link DiscordAutoModerationRule}.
976
- *
977
- * @remarks
978
- * Requires the `MANAGE_GUILD` permission.
979
- *
980
- * Fires an _Auto Moderation Rule Update_ gateway event.
981
- *
982
- * @see {@link https://docs.discord.com/developers/resources/auto-moderation#modify-auto-moderation-rule}
983
- */
984
- editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>, reason?: string) => Promise<Camelize<DiscordAutoModerationRule>>;
985
- /**
986
- * Modifies the bot's username, avatar or banner.
987
- *
988
- * @param options - The parameters for the edit of the bot's profile.
989
- * @returns An instance of the edited {@link DiscordUser}.
990
- *
991
- * @remarks
992
- * Editing the `username` may cause the bot's discriminator to be randomized.
993
- *
994
- * `avatar` and `banner` must to be a Data URI scheme. {@link urlToBase64} from `@discordeno/utils` can be used to convert a URL to a Data URI scheme.
995
- *
996
- * @see {@link https://docs.discord.com/developers/resources/user#modify-current-user}
997
- */
998
- editBotProfile: (options: {
999
- username?: string;
1000
- avatar?: string | null;
1001
- banner?: string | null;
1002
- }) => Promise<Camelize<DiscordUser>>;
1003
- /**
1004
- * Edits a channel's settings.
1005
- *
1006
- * @param channelId - The ID of the channel to edit.
1007
- * @param options - The parameters for the edit of the channel.
1008
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1009
- * @returns An instance of the edited {@link DiscordChannel}.
1010
- *
1011
- * @remarks
1012
- * If editing a channel of type {@link ChannelTypes}.GroupDm:
1013
- * - Fires a _Channel Update_ gateway event.
1014
- *
1015
- * If editing a thread channel:
1016
- * - Requires the `MANAGE_THREADS` permission __unless__ if setting the `archived` property to `false` when the `locked` property is also `false`, in which case only the `SEND_MESSAGES` permission is required.
1017
- *
1018
- * - Fires a _Thread Update_ gateway event.
1019
- *
1020
- * If editing a guild channel:
1021
- * - Requires the `MANAGE_CHANNELS` permission.
1022
- *
1023
- * - If modifying permission overrides:
1024
- * - Requires the `MANAGE_ROLES` permission.
1025
- *
1026
- * - Only permissions the bot user has in the guild or parent channel can be allowed/denied __unless__ the bot user has a `MANAGE_ROLES` permission override in the channel.
1027
- *
1028
- * - If modifying a channel of type {@link ChannelTypes}.GuildCategory:
1029
- * - Fires a _Channel Update_ gateway event for each child channel impacted in this change.
1030
- * - Otherwise:
1031
- * - Fires a _Channel Update_ gateway event.
1032
- */
1033
- editChannel: (channelId: BigString, options: ModifyChannel, reason?: string) => Promise<Camelize<DiscordChannel>>;
1034
- /**
1035
- * Edits the permission overrides for a user or role in a channel.
1036
- *
1037
- * @param channelId - The ID of the channel to edit the permission overrides of.
1038
- * @param options - The permission override.
1039
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1040
- *
1041
- * @remarks
1042
- * Requires the `MANAGE_ROLES` permission.
1043
- *
1044
- * Only permissions the bot user has in the guild or parent channel can be allowed/denied __unless__ the bot user has a `MANAGE_ROLES` permission override in the channel.
1045
- *
1046
- * Fires a _Channel Update_ gateway event.
1047
- *
1048
- * @see {@link https://docs.discord.com/developers/resources/channel#edit-channel-permissions}
1049
- */
1050
- editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions, reason?: string) => Promise<void>;
1051
- /**
1052
- * Edits the positions of a set of channels in a guild.
1053
- *
1054
- * @param guildId - The ID of the guild in which to edit the positions of the channels.
1055
- * @param channelPositions - A set of objects defining the updated positions of the channels.
1056
- *
1057
- * @remarks
1058
- * Requires the `MANAGE_CHANNELS` permission.
1059
- *
1060
- * Fires a _Channel Update_ gateway event for every channel impacted in this change.
1061
- *
1062
- * At most one entry per request may change `parent_id`. A request that changes `parent_id` for more than one channel fails with a 400 response and error code 40009.
1063
- *
1064
- * Permissions are checked per entry, based on what the entry changes:
1065
- * - An entry that only changes `position` requires the `MANAGE_CHANNELS` permission at the guild level (or on the channel's current parent category). It does **not** require access to the individual channel, so a full reordering may include channels the current user cannot view.
1066
- * - An entry that changes `parent_id` requires the `MANAGE_CHANNELS` permission on that channel and on the destination (the new parent category, or the guild when moving the channel out of a category), and the current user must be able to view the channel. Otherwise the request fails with a `403` response and error code 50001. Setting `lock_permissions` additionally requires `MANAGE_ROLES`.
1067
- *
1068
- * @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-channel-positions}
1069
- */
1070
- editChannelPositions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise<void>;
1071
- /**
1072
- * Edits an emoji.
1073
- *
1074
- * @param guildId - The ID of the guild in which to edit the emoji.
1075
- * @param id - The ID of the emoji to edit.
1076
- * @param options - The parameters for the edit of the emoji.
1077
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1078
- * @returns An instance of the updated {@link DiscordEmoji}.
1079
- *
1080
- * @remarks
1081
- * For emojis created by the current user, requires either the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
1082
- * For other emojis, requires the `MANAGE_GUILD_EXPRESSIONS` permission.
1083
- *
1084
- * Fires a `Guild Emojis Update` gateway event.
1085
- *
1086
- * @see {@link https://docs.discord.com/developers/resources/emoji#modify-guild-emoji}
1087
- */
1088
- editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji, reason?: string) => Promise<Camelize<DiscordEmoji>>;
1089
- /**
1090
- * Edits an application emoji.
1091
- *
1092
- * @param id - The ID of the emoji to edit.
1093
- * @param options - The parameters for the edit of the emoji.
1094
- * @returns An instance of the updated {@link DiscordEmoji}.
1095
- *
1096
- * @see {@link https://docs.discord.com/developers/resources/emoji#modify-application-emoji}
1097
- */
1098
- editApplicationEmoji: (id: BigString, options: ModifyApplicationEmoji) => Promise<Camelize<DiscordEmoji>>;
1099
- /**
1100
- * Edits a follow-up message to an interaction.
1101
- *
1102
- * @param token - The interaction token to use, provided in the original interaction.
1103
- * @param messageId - The ID of the message to edit.
1104
- * @param options - The parameters for the edit of the message.
1105
- * @returns An instance of the edited {@link DiscordMessage}.
1106
- *
1107
- * @remarks
1108
- * Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
1109
- *
1110
- * Does not support ephemeral follow-up messages due to these being stateless.
1111
- *
1112
- * Fires a _Message Update_ event.
1113
- *
1114
- * @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#edit-followup-message}
1115
- */
1116
- editFollowupMessage: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
1117
- /**
1118
- * Edits a global application command.
1119
- *
1120
- * @param commandId - The ID of the command to edit.
1121
- * @param options - The parameters for the edit of the command.
1122
- * @returns An instance of the edited {@link DiscordApplicationCommand}.
1123
- *
1124
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-global-application-command}
1125
- */
1126
- editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1127
- /**
1128
- * Edits a guild's settings.
1129
- *
1130
- * @param guildId - The ID of the guild to edit.
1131
- * @param options - The parameters for the edit of the guild.
1132
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1133
- * @returns An instance of the edited {@link DiscordGuild}.
1134
- *
1135
- * @remarks
1136
- * Requires the `MANAGE_GUILD` permission.
1137
- *
1138
- * If attempting to add or remove the {@link GuildFeatures}.Community feature:
1139
- * - Requires the `ADMINISTRATOR` permission.
1140
- *
1141
- * Fires a _Guild Update_ gateway event.
1142
- *
1143
- * @see {@link https://docs.discord.com/developers/resources/guild#modify-guild}
1144
- */
1145
- editGuild: (guildId: BigString, options: ModifyGuild, reason?: string) => Promise<Camelize<DiscordGuild>>;
1146
- /**
1147
- * Edits an application command registered in a guild.
1148
- *
1149
- * @param guildId - The ID of the guild the command is registered in.
1150
- * @param commandId - The ID of the command to edit.
1151
- * @param options - The parameters for the edit of the command.
1152
- * @returns An instance of the edited {@link DiscordApplicationCommand}.
1153
- *
1154
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-guild-application-command}
1155
- */
1156
- editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1157
- /**
1158
- * Edit the given sticker.
1159
- *
1160
- * @param guildId The ID of the guild to get
1161
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1162
- * @return A {@link DiscordSticker}
1163
- *
1164
- * @remarks
1165
- * For stickers created by the current user, requires either the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
1166
- * For other stickers, requires the `MANAGE_GUILD_EXPRESSIONS` permission.
1167
- * Fires a Guild Stickers Update Gateway event.
1168
- *
1169
- * @see {@link https://docs.discord.com/developers/resources/sticker#modify-guild-sticker}
1170
- */
1171
- editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>, reason?: string) => Promise<Camelize<DiscordSticker>>;
1172
- /**
1173
- * Edits a template's settings.
1174
- *
1175
- * @param guildId - The ID of the guild to edit a template of.
1176
- * @param templateCode - The code of the template to edit.
1177
- * @param options - The parameters for the edit of the template.
1178
- * @returns An instance of the edited {@link DiscordTemplate}.
1179
- *
1180
- * @remarks
1181
- * Requires the `MANAGE_GUILD` permission.
1182
- *
1183
- * Fires a _Guild Update_ gateway event.
1184
- *
1185
- * @see {@link https://docs.discord.com/developers/resources/guild-template#modify-guild-template}
1186
- */
1187
- editGuildTemplate: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<Camelize<DiscordTemplate>>;
1188
- /**
1189
- * Edits a message.
1190
- *
1191
- * @param channelId - The ID of the channel to edit the message in.
1192
- * @param messageId - The IDs of the message to edit.
1193
- * @param options - The parameters for the edit of the message.
1194
- * @returns An instance of the edited {@link DiscordMessage}.
1195
- *
1196
- * @remarks
1197
- * If editing another user's message:
1198
- * - Requires the `MANAGE_MESSAGES` permission.
1199
- * - Only the {@link EditMessage.flags | flags} property of the options object parameter can be edited.
1200
- *
1201
- * Fires a _Message Update_ gateway event.
1202
- *
1203
- * @see {@link https://docs.discord.com/developers/resources/channel#edit-message}
1204
- */
1205
- editMessage: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<Camelize<DiscordMessage>>;
1206
- /**
1207
- * Edits the initial message response to an interaction.
1208
- *
1209
- * @param token - The interaction token to use, provided in the original interaction.
1210
- * @param options - The parameters for the edit of the response.
1211
- * @returns An instance of the edited {@link DiscordMessage}.
1212
- *
1213
- * @remarks
1214
- * Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
1215
- *
1216
- * Does not support ephemeral follow-up messages due to these being stateless.
1217
- *
1218
- * Fires a _Message Update_ event.
1219
- *
1220
- * @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#edit-original-interaction-response}
1221
- */
1222
- editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
1223
- /**
1224
- * Edits the voice state of the bot user.
1225
- *
1226
- * @param guildId - The ID of the guild in which to edit the voice state of the bot user.
1227
- * @param options - The parameters for the edit of the voice state.
1228
- *
1229
- * @remarks
1230
- * The {@link EditOwnVoiceState.channelId | channelId} property of the options object parameter must point to a stage channel, and the bot user must already have joined it.
1231
- *
1232
- * If attempting to unmute oneself:
1233
- * - Requires the `MUTE_MEMBERS` permission.
1234
- *
1235
- * If attempting to request to speak:
1236
- * - Requires the `REQUEST_TO_SPEAK` permission.
1237
- *
1238
- * @see {@link https://docs.discord.com/developers/resources/voice#modify-current-user-voice-state}
1239
- */
1240
- editOwnVoiceState: (guildId: BigString, options: EditOwnVoiceState) => Promise<void>;
1241
- /**
1242
- * Edits a role in a guild.
1243
- *
1244
- * @param guildId - The ID of the guild to edit the role in.
1245
- * @param roleId - The ID of the role to edit.
1246
- * @param options - The parameters for the edit of the role.
1247
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1248
- * @returns An instance of the edited {@link DiscordRole}.
1249
- *
1250
- * @remarks
1251
- * Requires the `MANAGE_ROLES` permission.
1252
- *
1253
- * Fires a _Guild Role Update_ gateway event.
1254
- *
1255
- * @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-role}
1256
- */
1257
- editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
1258
- /**
1259
- * Edits the positions of a set of roles.
1260
- *
1261
- * @param guildId - The ID of the guild to edit the role positions in.
1262
- * @param options - The parameters for the edit of the role positions.
1263
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1264
- * @returns A collection of {@link DiscordRole} objects assorted by role ID.
1265
- *
1266
- * @remarks
1267
- * Requires the `MANAGE_ROLES` permission.
1268
- *
1269
- * Fires a _Guild Role Update_ gateway event for every role impacted in this change.
1270
- *
1271
- * @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-role-positions}
1272
- */
1273
- editRolePositions: (guildId: BigString, options: ModifyRolePositions[], reason?: string) => Promise<Camelize<DiscordRole>[]>;
1274
- /**
1275
- * Edits a scheduled event.
1276
- *
1277
- * @param guildId - The ID of the guild to edit the scheduled event in.
1278
- * @param eventId - The ID of the scheduled event to edit.
1279
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1280
- * @returns An instance of the edited {@link DiscordScheduledEvent}.
1281
- *
1282
- * @remarks
1283
- * Requires the `MANAGE_EVENTS` permission.
1284
- *
1285
- * To start or end an event, modify the event's `status` property.
1286
- *
1287
- * The `entity_metadata` property is discarded for events whose `entity_type` is not {@link ScheduledEventEntityType}.External.
1288
- *
1289
- * Fires a _Guild Scheduled Event Update_ gateway event.
1290
- *
1291
- * @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#modify-guild-scheduled-event}
1292
- */
1293
- editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>, reason?: string) => Promise<Camelize<DiscordScheduledEvent>>;
1294
- /**
1295
- * Edits a stage instance.
1296
- *
1297
- * @param channelId - The ID of the stage channel the stage instance is associated with.
1298
- * @param topic - Topic of the Stage instance (1-120 characters).
1299
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1300
- * @returns An instance of the updated {@link DiscordStageInstance}.
1301
- *
1302
- * @remarks
1303
- * Requires the user to be a moderator of the stage channel.
1304
- *
1305
- * Fires a _Stage Instance Update_ event.
1306
- *
1307
- * @see {@link https://docs.discord.com/developers/resources/stage-instance#modify-stage-instance}
1308
- */
1309
- editStageInstance: (channelId: BigString, topic: string, reason?: string) => Promise<Camelize<DiscordStageInstance>>;
1310
- /**
1311
- * Edits the voice state of another user.
1312
- *
1313
- * @param guildId - The ID of the guild in which to edit the voice state of the bot user.
1314
- * @param options - The parameters for the edit of the voice state.
1315
- *
1316
- * @remarks
1317
- * The {@link EditOwnVoiceState.channelId | channelId} property of the options object parameter must point to a stage channel, and the user must already have joined it.
1318
- *
1319
- * Requires the `MUTE_MEMBERS` permission.
1320
- *
1321
- * @see {@link https://docs.discord.com/developers/resources/voice#modify-user-voice-state}
1322
- */
1323
- editUserVoiceState: (guildId: BigString, options: EditUserVoiceState) => Promise<void>;
1324
- /**
1325
- * Edit the current user application role connection for the application.
1326
- *
1327
- * @param bearerToken - The access token of the user
1328
- * @param applicationId - The id of the application to edit the role connection
1329
- * @param options - The options to edit
1330
- * @returns {DiscordApplicationRoleConnection}
1331
- *
1332
- * @remarks
1333
- * This requires the `role_connections.write` scope.
1334
- *
1335
- * @see {@link https://docs.discord.com/developers/resources/user#update-user-application-role-connection}
1336
- */
1337
- editUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString, options: Camelize<DiscordApplicationRoleConnection>) => Promise<Camelize<DiscordApplicationRoleConnection>>;
1338
- /**
1339
- * Deletes the application role connection for the user.
1340
- *
1341
- * @param bearerToken - The access token of the user
1342
- * @param applicationId - The id of the application to delete the role connection
1343
- *
1344
- * @remarks
1345
- * This requires the `role_connections.write` scope.
1346
- *
1347
- * @see {@link https://docs.discord.com/developers/resources/user#delete-current-user-application-role-connection}
1348
- */
1349
- deleteCurrentUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString) => Promise<void>;
1350
- /**
1351
- * Edits a webhook.
1352
- *
1353
- * @param webhookId - The ID of the webhook to edit.
1354
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1355
- * @returns An instance of the edited {@link DiscordWebhook}.
1356
- *
1357
- * @remarks
1358
- * Requires the `MANAGE_WEBHOOKS` permission.
1359
- *
1360
- * Fires a _Webhooks Update_ gateway event.
1361
- *
1362
- * @see {@link https://docs.discord.com/developers/resources/webhook#edit-webhook}
1363
- */
1364
- editWebhook: (webhookId: BigString, options: ModifyWebhook, reason?: string) => Promise<Camelize<DiscordWebhook>>;
1365
- /**
1366
- * Edits a webhook message.
1367
- *
1368
- * @param webhookId - The ID of the webhook to edit the message of.
1369
- * @param token - The webhook token, used to edit the message.
1370
- * @param messageId - The ID of the message to edit.
1371
- * @param options - The parameters for the edit of the message.
1372
- * @returns An instance of the edited {@link DiscordMessage}.
1373
- *
1374
- * @remarks
1375
- * Fires a _Message Update_ gateway event.
1376
- *
1377
- * @see {@link https://docs.discord.com/developers/resources/webhook#edit-webhook-message}
1378
- */
1379
- editWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options: EditWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
1380
- /**
1381
- * Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
1382
- *
1383
- * @param webhookId - The ID of the webhook to edit.
1384
- * @param token - The webhook token, used to edit the webhook.
1385
- * @returns An instance of the edited {@link DiscordWebhook}.
1386
- *
1387
- * @remarks
1388
- * Requires the `MANAGE_WEBHOOKS` permission.
1389
- *
1390
- * Fires a _Webhooks Update_ gateway event.
1391
- *
1392
- * @see {@link https://docs.discord.com/developers/resources/webhook#modify-webhook-with-token}
1393
- */
1394
- editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
1395
- /**
1396
- * Edits a guild's welcome screen.
1397
- *
1398
- * @param guildId - The ID of the guild to edit the welcome screen of.
1399
- * @param options - The parameters for the edit of the welcome screen.
1400
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1401
- * @returns An instance of the edited {@link DiscordWelcomeScreen}.
1402
- *
1403
- * @remarks
1404
- * Requires the `MANAGE_GUILD` permission.
1405
- *
1406
- * Fires a _Guild Update_ gateway event.
1407
- *
1408
- * @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-welcome-screen}
1409
- */
1410
- editWelcomeScreen: (guildId: BigString, options: ModifyGuildWelcomeScreen, reason?: string) => Promise<Camelize<DiscordWelcomeScreen>>;
1411
- /**
1412
- * Edits the settings of a guild's widget.
1413
- *
1414
- * @param guildId - The ID of the guild to edit the settings of the widget of.
1415
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1416
- * @returns An instance of the edited {@link DiscordGuildWidgetSettings}.
1417
- *
1418
- * @remarks
1419
- * Requires the `MANAGE_GUILD` permission.
1420
- *
1421
- * Fires a _Guild Update_ gateway event.
1422
- *
1423
- * @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-widget}
1424
- */
1425
- editWidgetSettings: (guildId: BigString, options: Camelize<DiscordGuildWidgetSettings>, reason?: string) => Promise<Camelize<DiscordGuildWidgetSettings>>;
1426
- /**
1427
- * Executes a webhook, causing a message to be posted in the channel configured for the webhook.
1428
- *
1429
- * @param webhookId - The ID of the webhook to execute.
1430
- * @param token - The webhook token, used to execute the webhook.
1431
- * @param options - The parameters for the execution of the webhook.
1432
- * @returns An instance of the created {@link DiscordMessage}, or `undefined` if the {@link ExecuteWebhook.wait | wait} property of the options object parameter is set to `false`.
1433
- *
1434
- * @remarks
1435
- * If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
1436
- *
1437
- * @see {@link https://docs.discord.com/developers/resources/webhook#execute-webhook}
1438
- */
1439
- executeWebhook: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<Camelize<DiscordMessage> | undefined>;
1440
- /**
1441
- * Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.
1442
- *
1443
- * @param sourceChannelId - The ID of the announcement channel to follow.
1444
- * @param targetChannelId - The ID of the target channel - the channel to cross-post to.
1445
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
1446
- * @returns An instance of {@link DiscordFollowedChannel}.
1447
- *
1448
- * @remarks
1449
- * Requires the `MANAGE_WEBHOOKS` permission in the __target channel__.
1450
- *
1451
- * Fires a _Webhooks Update_ gateway event.
1452
- *
1453
- * @see {@link https://docs.discord.com/developers/resources/channel#follow-announcement-channel}
1454
- */
1455
- followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString, reason?: string) => Promise<Camelize<DiscordFollowedChannel>>;
1456
- /**
1457
- * Gets the list of all active threads for a guild.
1458
- *
1459
- * @param guildId - The ID of the guild to get the threads of.
1460
- * @returns An instance of {@link DiscordListActiveThreads}.
1461
- *
1462
- * @remarks
1463
- * Returns both public and private threads.
1464
- *
1465
- * Threads are ordered by the `id` property in descending order.
1466
- *
1467
- * @see {@link https://docs.discord.com/developers/resources/guild#list-active-guild-threads}
1468
- */
1469
- getActiveThreads: (guildId: BigString) => Promise<Camelize<DiscordListActiveThreads>>;
1470
- /** Get the applications info */
1471
- getApplicationInfo: () => Promise<Camelize<DiscordApplication>>;
1472
- /**
1473
- * Edit properties of the app associated with the requesting bot user.
1474
- *
1475
- * @remarks
1476
- * Only properties that are passed will be updated.
1477
- */
1478
- editApplicationInfo: (body: EditApplication) => Promise<Camelize<DiscordApplication>>;
1479
- /**
1480
- * Get the current authentication info for the authenticated user
1481
- *
1482
- * @param bearerToken - Any OAuth2 derived access token
1483
- * @returns An instance of {@link DiscordCurrentAuthorization}
1484
- *
1485
- * @remarks
1486
- * The user object is not defined if the scopes do not include `identify`.
1487
- * In the user object, if defined, the email is not included if the scopes do not include `email`
1488
- */
1489
- getCurrentAuthenticationInfo: (bearerToken: string) => Promise<Camelize<DiscordCurrentAuthorization>>;
1490
- /**
1491
- * Exchange the information to get a OAuth2 accessToken token
1492
- *
1493
- * @param clientId - Application's client id
1494
- * @param clientSecret - application's client secret
1495
- * @param options - The options to make the exchange with discord
1496
- */
1497
- exchangeToken: (clientId: BigString, clientSecret: string, options: Camelize<DiscordTokenExchange>) => Promise<Camelize<DiscordAccessTokenResponse>>;
1498
- /**
1499
- * Revoke an access_token
1500
- *
1501
- * @param clientId - Application's client id
1502
- * @param clientSecret - application's client secret
1503
- * @param options - The options to revoke the access_token
1504
- */
1505
- revokeToken: (clientId: BigString, clientSecret: string, options: Camelize<DiscordTokenRevocation>) => Promise<void>;
1506
- /**
1507
- * Gets the permissions of a guild application command.
1508
- *
1509
- * @param guildId - The ID of the guild the command is registered in.
1510
- * @param commandId - The ID of the command to get the permissions of.
1511
- * @param options - The OAuth2 related optional parameters for the endpoint
1512
- * @returns An instance of {@link DiscordGuildApplicationCommandPermissions}.
1513
- *
1514
- * @remarks
1515
- * Then specifying the options object the access token passed-in requires the OAuth2 scope `applications.commands.permissions.update`
1516
- *
1517
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#get-application-command-permissions}
1518
- */
1519
- getApplicationCommandPermission: (guildId: BigString, commandId: BigString, options?: GetApplicationCommandPermissionOptions) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>>;
1520
- /**
1521
- * Gets the permissions of all application commands registered in a guild by the ID of the guild and optionally an external application.
1522
- *
1523
- * @param guildId - The ID of the guild to get the permissions objects of.
1524
- * @param options - The OAuth2 related optional parameters for the endpoint
1525
- * @returns A collection of {@link DiscordGuildApplicationCommandPermissions} objects assorted by command ID.
1526
- *
1527
- * @remarks
1528
- * Then specifying the options object the access token passed-in requires the OAuth2 scope `applications.commands.permissions.update`
1529
- *
1530
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#get-guild-application-command-permissions}
1531
- */
1532
- getApplicationCommandPermissions: (guildId: BigString, options?: GetApplicationCommandPermissionOptions) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>[]>;
1533
- /**
1534
- * Gets a guild's audit log.
1535
- *
1536
- * @param guildId - The ID of the guild to get the audit log of.
1537
- * @param options - The parameters for the fetching of the audit log.
1538
- * @returns An instance of {@link DiscordAuditLog}.
1539
- *
1540
- * @remarks
1541
- * Requires the `VIEW_AUDIT_LOG` permission.
1542
- *
1543
- * @see {@link https://docs.discord.com/developers/resources/audit-log#get-guild-audit-log}
1544
- */
1545
- getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
1546
- /**
1547
- * Gets an automod rule by its ID.
1548
- *
1549
- * @param guildId - The ID of the guild to get the rule of.
1550
- * @param ruleId - The ID of the rule to get.
1551
- * @returns An instance of {@link DiscordAutoModerationRule}.
1552
- *
1553
- * @remarks
1554
- * Requires the `MANAGE_GUILD` permission.
1555
- *
1556
- * @see {@link https://docs.discord.com/developers/resources/auto-moderation#get-auto-moderation-rule}
1557
- */
1558
- getAutomodRule: (guildId: BigString, ruleId: BigString) => Promise<Camelize<DiscordAutoModerationRule>>;
1559
- /**
1560
- * Gets the list of automod rules for a guild.
1561
- *
1562
- * @param guildId - The ID of the guild to get the rules from.
1563
- * @returns A collection of {@link DiscordAutoModerationRule} objects assorted by rule ID.
1564
- *
1565
- * @remarks
1566
- * Requires the `MANAGE_GUILD` permission.
1567
- *
1568
- * @see {@link https://docs.discord.com/developers/resources/auto-moderation#list-auto-moderation-rules-for-guild}
1569
- */
1570
- getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule>[]>;
1571
- /**
1572
- * Gets the list of available voice regions.
1573
- *
1574
- * @returns A collection of {@link DiscordVoiceRegion} objects assorted by voice region ID.
1575
- */
1576
- getAvailableVoiceRegions: () => Promise<Camelize<DiscordVoiceRegion>[]>;
1577
- /**
1578
- * Gets a ban by user ID.
1579
- *
1580
- * @param guildId - The ID of the guild to get the ban from.
1581
- * @param userId - The ID of the user to get the ban for.
1582
- * @returns An instance of {@link DiscordBan}.
1583
- *
1584
- * @remarks
1585
- * Requires the `BAN_MEMBERS` permission.
1586
- *
1587
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-ban}
1588
- */
1589
- getBan: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
1590
- /**
1591
- * Gets the list of bans for a guild.
1592
- *
1593
- * @param guildId - The ID of the guild to get the list of bans for.
1594
- * @param options - The parameters for the fetching of the list of bans.
1595
- * @returns A collection of {@link DiscordBan} objects assorted by user ID.
1596
- *
1597
- * @remarks
1598
- * Requires the `BAN_MEMBERS` permission.
1599
- *
1600
- * Users are ordered by their IDs in _ascending_ order.
1601
- *
1602
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-bans}
1603
- */
1604
- getBans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan>[]>;
1605
- /**
1606
- * Gets a channel by its ID.
1607
- *
1608
- * @param channelId - The ID of the channel to get.
1609
- * @returns An instance of {@link DiscordChannel}.
1610
- *
1611
- * @remarks
1612
- * If the channel is a thread, a {@link DiscordThreadMember} object is included in the result.
1613
- *
1614
- * @see {@link https://docs.discord.com/developers/resources/channel#get-channel}
1615
- */
1616
- getChannel: (channelId: BigString) => Promise<Camelize<DiscordChannel>>;
1617
- /**
1618
- * Gets the list of invites for a channel.
1619
- *
1620
- * @param channelId - The ID of the channel to get the invites of.
1621
- * @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
1622
- *
1623
- * @remarks
1624
- * Requires the `MANAGE_CHANNELS` permission.
1625
- *
1626
- * Only usable for guild channels.
1627
- *
1628
- * @see {@link https://docs.discord.com/developers/resources/channel#get-channel-invites}
1629
- */
1630
- getChannelInvites: (channelId: BigString) => Promise<Camelize<DiscordInviteMetadata>[]>;
1631
- /**
1632
- * Gets the list of channels for a guild.
1633
- *
1634
- * @param guildId - The ID of the guild to get the channels of.
1635
- * @returns A collection of {@link DiscordChannel} objects assorted by channel ID.
1636
- *
1637
- * @remarks
1638
- * Excludes threads.
1639
- *
1640
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-channels}
1641
- */
1642
- getChannels: (guildId: BigString) => Promise<Camelize<DiscordChannel>[]>;
1643
- /**
1644
- * Gets a list of webhooks for a channel.
1645
- *
1646
- * @param channelId - The ID of the channel which to get the webhooks of.
1647
- * @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
1648
- *
1649
- * @remarks
1650
- * Requires the `MANAGE_WEBHOOKS` permission.
1651
- *
1652
- * @see {@link https://docs.discord.com/developers/resources/webhook#get-channel-webhooks}
1653
- */
1654
- getChannelWebhooks: (channelId: BigString) => Promise<Camelize<DiscordWebhook>[]>;
1655
- /**
1656
- * Gets or creates a DM channel with a user.
1657
- *
1658
- * @param userId - The ID of the user to create the DM channel with.
1659
- * @returns An instance of {@link DiscordChannel}.
1660
- *
1661
- * @see {@link https://docs.discord.com/developers/resources/user#create-dm}
1662
- */
1663
- getDmChannel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
1664
- /**
1665
- * Create a new group DM channel with multiple users.
1666
- *
1667
- * @param options - The options for create a new group dm
1668
- * @returns An instance of {@link DiscordChannel}.
1669
- *
1670
- * @remarks
1671
- * The access tokens require to have the `gdm.join` scope
1672
- *
1673
- * This endpoint is limited to 10 active group DMs.
1674
- *
1675
- * Fires a _Channel create_ gateway event.
1676
- *
1677
- * @see {@link https://docs.discord.com/developers/resources/user#create-group-dm}
1678
- */
1679
- getGroupDmChannel: (options: CreateGroupDmOptions) => Promise<Camelize<DiscordChannel>>;
1680
- /**
1681
- * Gets an emoji by its ID.
1682
- *
1683
- * @param guildId - The ID of the guild from which to get the emoji.
1684
- * @param emojiId - The ID of the emoji to get.
1685
- * @returns An instance of {@link DiscordEmoji}.
1686
- *
1687
- * @remarks
1688
- * Includes the `user` field if the bot has the `MANAGE_GUILD_EXPRESSIONS` permission,
1689
- * or if the bot created the emoji and has the `CREATE_GUILD_EXPRESSIONS` permission.
1690
- *
1691
- * @see {@link https://docs.discord.com/developers/resources/emoji#get-guild-emoji}
1692
- */
1693
- getEmoji: (guildId: BigString, emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
1694
- /**
1695
- * Gets an application emoji by its ID.
1696
- *
1697
- * @param emojiId - The ID of the emoji to get.
1698
- * @returns An instance of {@link DiscordEmoji}.
1699
- *
1700
- * @remarks
1701
- * Always includes the `user` object for the team member that uploaded the emoji from the app's settings, or for the bot user if uploaded using the API.
1702
- *
1703
- * @see {@link https://docs.discord.com/developers/resources/emoji#get-application-emoji}
1704
- */
1705
- getApplicationEmoji: (emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
1706
- /**
1707
- * Gets the list of emojis for a guild.
1708
- *
1709
- * @param guildId - The ID of the guild which to get the emojis of.
1710
- * @returns A collection of {@link DiscordEmoji} objects assorted by emoji ID.
1711
- *
1712
- * @remarks
1713
- * Includes `user` fields if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
1714
- *
1715
- * @see {@link https://docs.discord.com/developers/resources/emoji#list-guild-emojis}
1716
- */
1717
- getEmojis: (guildId: BigString) => Promise<Camelize<DiscordEmoji>[]>;
1718
- /**
1719
- * Gets the list of emojis for an application.
1720
- *
1721
- * @returns An object with the array of {@link DiscordEmoji} objects.
1722
- *
1723
- * @remarks
1724
- * Always includes the `user` object for the team member that uploaded the emoji from the app's settings, or for the bot user if uploaded using the API.
1725
- *
1726
- * @see {@link https://docs.discord.com/developers/resources/emoji#list-application-emojis}
1727
- */
1728
- getApplicationEmojis: () => Promise<{
1729
- items: Camelize<DiscordEmoji>[];
1730
- }>;
1731
- /**
1732
- * Gets a follow-up message to an interaction by the ID of the message.
1733
- *
1734
- * @param token - The interaction token to use, provided in the original interaction.
1735
- * @param messageId - The ID of the message to get.
1736
- * @returns An instance of {@link DiscordMessage}.
1737
- *
1738
- * @remarks
1739
- * Unlike `getMessage()`, this endpoint allows the bot user to act without:
1740
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1741
- * - Requiring the `MESSAGE_CONTENT` intent.
1742
- *
1743
- * Does not support ephemeral follow-up messages due to these being stateless.
1744
- *
1745
- * @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#get-followup-message}
1746
- */
1747
- getFollowupMessage: (token: string, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
1748
- /** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
1749
- getGatewayBot: () => Promise<Camelize<DiscordGetGatewayBot>>;
1750
- /**
1751
- * Gets a global application command by its ID.
1752
- *
1753
- * @param commandId - The ID of the command to get.
1754
- * @returns An instance of {@link DiscordApplicationCommand}.
1755
- *
1756
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-command}
1757
- */
1758
- getGlobalApplicationCommand: (commandId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
1759
- /**
1760
- * Gets the list of your bot's global application commands.
1761
- *
1762
- * @param options - The parameters for the fetching of global application commands
1763
- * @returns A collection of {@link DiscordApplicationCommand} objects assorted by command ID.
1764
- *
1765
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-commands}
1766
- */
1767
- getGlobalApplicationCommands: (options?: GetGlobalApplicationCommandsOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
1768
- /**
1769
- * Gets a guild by its ID.
1770
- *
1771
- * @param guildId - The ID of the guild to get.
1772
- * @param options - The parameters for the fetching of the guild.
1773
- * @returns An instance of {@link DiscordGuild}.
1774
- *
1775
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild}
1776
- */
1777
- getGuild: (guildId: BigString, options?: {
1778
- counts?: boolean;
1779
- }) => Promise<Camelize<DiscordGuild>>;
1780
- /**
1781
- * Get the user guilds.
1782
- *
1783
- * @param bearerToken - The access token of the user, if unspecified the bot token is used instead
1784
- * @param options - The parameters for the fetching of the guild.
1785
- * @returns An array of partial {@link DiscordGuild}.
1786
- *
1787
- * @remarks
1788
- * If used with an access token, the token needs to have the `guilds` scope
1789
- *
1790
- * @see {@link https://docs.discord.com/developers/resources/user#get-current-user-guilds}
1791
- */
1792
- getGuilds: (bearerToken?: string, options?: GetUserGuilds) => Promise<Partial<Camelize<DiscordGuild>>[]>;
1793
- /**
1794
- * Gets a guild application command by its ID.
1795
- *
1796
- * @param guildId - The ID of the guild the command is registered in.
1797
- * @param commandId - The ID of the command to get.
1798
- * @returns An instance of {@link DiscordApplicationCommand}.
1799
- *
1800
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#get-guild-application-command}
1801
- */
1802
- getGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
1803
- /**
1804
- * Gets the list of application commands registered by your bot in a guild.
1805
- *
1806
- * @param guildId - The ID of the guild the commands are registered in.
1807
- * @param options - The parameters for the fetching of guild application commands
1808
- * @returns A collection of {@link DiscordApplicationCommand} objects assorted by command ID.
1809
- *
1810
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-commandss}
1811
- */
1812
- getGuildApplicationCommands: (guildId: BigString, options?: GetGuildApplicationCommandsOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
1813
- /**
1814
- * Gets the preview of a guild by a guild's ID.
1815
- *
1816
- * @param guildId - The ID of the guild to get the preview of.
1817
- * @returns An instance of {@link DiscordGuildPreview}.
1818
- *
1819
- * @remarks
1820
- * If the bot user is not in the guild, the guild must be discoverable.
1821
- *
1822
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-preview}
1823
- */
1824
- getGuildPreview: (guildId: BigString) => Promise<Camelize<DiscordGuildPreview>>;
1825
- /**
1826
- * Returns a sticker object for the given guild and sticker IDs.
1827
- *
1828
- * @param guildId The ID of the guild to get
1829
- * @param stickerId The ID of the sticker to get
1830
- * @return A {@link DiscordSticker}
1831
- *
1832
- * @remarks Includes the user field if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
1833
- *
1834
- * @see {@link https://docs.discord.com/developers/resources/sticker#get-guild-sticker}
1835
- */
1836
- getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
1837
- /**
1838
- * Returns an array of sticker objects for the given guild.
1839
- *
1840
- * @param guildId The ID of the guild to get
1841
- * @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
1842
- *
1843
- * @remarks Includes user fields if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
1844
- *
1845
- * @see {@link https://docs.discord.com/developers/resources/sticker#list-guild-stickers}
1846
- */
1847
- getGuildStickers: (guildId: BigString) => Promise<Camelize<DiscordSticker>[]>;
1848
- /**
1849
- * Gets a template by its code.
1850
- *
1851
- * @param templateCode - The code of the template to get.
1852
- * @returns An instance of {@link DiscordTemplate}.
1853
- *
1854
- * @remarks
1855
- * Requires the `MANAGE_GUILD` permission.
1856
- *
1857
- * @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-template}
1858
- */
1859
- getGuildTemplate: (templateCode: string) => Promise<Camelize<DiscordTemplate>>;
1860
- /**
1861
- * Gets the list of templates for a guild.
1862
- *
1863
- * @param guildId - The ID of the guild to get the list of templates for.
1864
- * @returns A collection of {@link DiscordTemplate} objects assorted by template code.
1865
- *
1866
- * @remarks
1867
- * Requires the `MANAGE_GUILD` permission.
1868
- *
1869
- * @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-templates}
1870
- */
1871
- getGuildTemplates: (guildId: BigString) => Promise<Camelize<DiscordTemplate>[]>;
1872
- /**
1873
- * Gets the list of webhooks for a guild.
1874
- *
1875
- * @param guildId - The ID of the guild to get the list of webhooks for.
1876
- * @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
1877
- *
1878
- * @remarks
1879
- * Requires the `MANAGE_WEBHOOKS` permission.
1880
- *
1881
- * @see {@link https://docs.discord.com/developers/resources/webhook#get-guild-webhooks}
1882
- */
1883
- getGuildWebhooks: (guildId: BigString) => Promise<Camelize<DiscordWebhook>[]>;
1884
- /**
1885
- * Gets the list of integrations attached to a guild.
1886
- *
1887
- * @param guildId - The ID of the guild to get the list of integrations from.
1888
- * @returns A collection of {@link DiscordIntegration} objects assorted by integration ID.
1889
- *
1890
- * @remarks
1891
- * Requires the `MANAGE_GUILD` permission.
1892
- *
1893
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-integrations}
1894
- */
1895
- getIntegrations: (guildId: BigString) => Promise<Camelize<DiscordIntegration>[]>;
1896
- /**
1897
- * Gets an invite to a channel by its invite code.
1898
- *
1899
- * @param inviteCode - The invite code of the invite to get.
1900
- * @param options - The parameters for the fetching of the invite.
1901
- * @returns An instance of {@link DiscordInviteMetadata}.
1902
- *
1903
- * @see {@link https://docs.discord.com/developers/resources/invite#get-invite}
1904
- */
1905
- getInvite: (inviteCode: string, options?: GetInvite) => Promise<Camelize<DiscordInviteMetadata>>;
1906
- /**
1907
- * Gets the list of invites for a guild.
1908
- *
1909
- * @param guildId - The ID of the guild to get the invites from.
1910
- * @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
1911
- *
1912
- * @remarks
1913
- * Requires the `MANAGE_GUILD` or `VIEW_AUDIT_LOG` permission.
1914
- *
1915
- * @see {@link https://docs.discord.com/developers/resources/invite#get-invites}
1916
- */
1917
- getInvites: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata>[]>;
1918
- /**
1919
- * Gets a message from a channel by the ID of the message.
1920
- *
1921
- * @param channelId - The ID of the channel from which to get the message.
1922
- * @param messageId - The ID of the message to get.
1923
- * @returns An instance of {@link DiscordMessage}.
1924
- *
1925
- * @remarks
1926
- * Requires that the bot user be able to see the contents of the channel in which the message was posted.
1927
- *
1928
- * If getting a message from a guild channel:
1929
- * - Requires the `READ_MESSAGE_HISTORY` permission.
1930
- *
1931
- * @see {@link https://docs.discord.com/developers/resources/channel#get-channel-message}
1932
- */
1933
- getMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
1934
- /**
1935
- * Gets multiple messages from a channel.
1936
- *
1937
- * @param channelId - The ID of the channel from which to get the messages.
1938
- * @param options - The parameters for the fetching of the messages.
1939
- * @returns Returns an array of {@link DiscordMessage} objects from newest to oldest on success.
1940
- *
1941
- * @remarks
1942
- * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
1943
- *
1944
- * If getting a messages from a guild channel:
1945
- * - Requires the `READ_MESSAGE_HISTORY` permission.
1946
- *
1947
- * @see {@link https://docs.discord.com/developers/resources/channel#get-channel-messages}
1948
- */
1949
- getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<Camelize<DiscordMessage>[]>;
1950
- /**
1951
- * Search messages in a guild.
1952
- *
1953
- * @remarks
1954
- * Requires `READ_MESSAGE_HISTORY` and is restricted by the `MESSAGE_CONTENT` intent.
1955
- *
1956
- * @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
1957
- */
1958
- searchGuildMessages: (guildId: BigString, options?: SearchGuildMessagesOptions) => Promise<Camelize<DiscordSearchGuildMessages | DiscordSearchGuildMessagesIndexing>>;
1959
- /**
1960
- * Returns a sticker pack for the given ID.
1961
- *
1962
- * @returns A {@link DiscordStickerPack} object.
1963
- *
1964
- * @see {@link https://docs.discord.com/developers/resources/sticker#get-sticker-pack}
1965
- */
1966
- getStickerPack: (stickerPackId: BigString) => Promise<Camelize<DiscordStickerPack>>;
1967
- /**
1968
- * Returns the list of sticker packs available.
1969
- *
1970
- * @returns A collection of {@link DiscordStickerPack} objects assorted by sticker ID.
1971
- *
1972
- * @see {@link https://docs.discord.com/developers/resources/sticker#list-sticker-packs}
1973
- */
1974
- getStickerPacks: () => Promise<Camelize<DiscordStickerPack>[]>;
1975
- /**
1976
- * Gets the initial message response to an interaction.
1977
- *
1978
- * @param token - The interaction token to use, provided in the original interaction.
1979
- * @returns An instance of {@link DiscordMessage}.
1980
- *
1981
- * @remarks
1982
- * Unlike `getMessage()`, this endpoint allows the bot user to act without:
1983
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1984
- * - Requiring the `MESSAGE_CONTENT` intent.
1985
- *
1986
- * Does not support ephemeral follow-up messages due to these being stateless.
1987
- *
1988
- * @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#get-original-interaction-response}
1989
- */
1990
- getOriginalInteractionResponse: (token: string) => Promise<Camelize<DiscordMessage>>;
1991
- /**
1992
- * Retrieves the list of pins in a channel.
1993
- *
1994
- * @param channelId - The ID of the channel to get the pins for.
1995
- * @param options - The options for the fetching of the pins.
1996
- * @returns A {@link DiscordGetChannelPins} objects
1997
- *
1998
- * @remarks
1999
- * Requires the `VIEW_CHANNEL` permission.
2000
- *
2001
- * If the user is missing the `READ_MESSAGE_HISTORY` permission in the channel, then no pins will be returned.
2002
- *
2003
- * @see {@link https://docs.discord.com/developers/resources/message#get-channel-pins}
2004
- */
2005
- getChannelPins: (channelId: BigString, options?: GetChannelPinsOptions) => Promise<Camelize<DiscordGetChannelPins>>;
2006
- /**
2007
- * Gets the pinned messages for a channel.
2008
- *
2009
- * @param channelId - The ID of the channel to get the pinned messages for.
2010
- * @returns A collection of {@link DiscordMessage} objects assorted by message ID.
2011
- *
2012
- * @remarks
2013
- * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
2014
- *
2015
- * If getting a message from a guild channel:
2016
- * - Requires the `READ_MESSAGE_HISTORY` permission.
2017
- *
2018
- * @see {@link https://docs.discord.com/developers/resources/message#get-pinned-messages-deprecated}
2019
- * @deprecated Use {@link getChannelPins} instead.
2020
- */
2021
- getPinnedMessages: (channelId: BigString) => Promise<Camelize<DiscordMessage>[]>;
2022
- /**
2023
- * Gets the list of private archived threads for a channel.
2024
- *
2025
- * @param channelId - The ID of the channel to get the archived threads for.
2026
- * @param options - The parameters for the fetching of threads.
2027
- * @returns An instance of {@link DiscordListArchivedThreads}.
2028
- *
2029
- * @remarks
2030
- * Requires the `READ_MESSAGE_HISTORY` permission.
2031
- * Requires the `MANAGE_THREADS` permission.
2032
- *
2033
- * Returns threads of type {@link ChannelTypes}.GuildPrivateThread.
2034
- *
2035
- * Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
2036
- *
2037
- * @see {@link https://docs.discord.com/developers/resources/channel#list-private-archived-threads}
2038
- */
2039
- getPrivateArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
2040
- /**
2041
- * Gets the list of private archived threads the bot is a member of for a channel.
2042
- *
2043
- * @param channelId - The ID of the channel to get the archived threads for.
2044
- * @param options - The parameters for the fetching of threads.
2045
- * @returns An instance of {@link DiscordListArchivedThreads}.
2046
- *
2047
- * @remarks
2048
- * Requires the `READ_MESSAGE_HISTORY` permission.
2049
- *
2050
- * Returns threads of type {@link ChannelTypes}.GuildPrivateThread.
2051
- *
2052
- * Threads are ordered by the `id` property in descending order.
2053
- *
2054
- * @see {@link https://docs.discord.com/developers/resources/channel#list-joined-private-archived-threads}
2055
- */
2056
- getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
2057
- /**
2058
- * Gets the number of members that would be kicked from a guild during pruning.
2059
- *
2060
- * @param guildId - The ID of the guild to get the prune count of.
2061
- * @param options - The parameters for the fetching of the prune count.
2062
- * @returns A number indicating the number of members that would be kicked.
2063
- *
2064
- * @remarks
2065
- * Requires the `MANAGE_GUILD` and `KICK_MEMBERS` permissions.
2066
- *
2067
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-prune-count}
2068
- */
2069
- getPruneCount: (guildId: BigString, options?: GetGuildPruneCountQuery) => Promise<Camelize<DiscordPrunedCount>>;
2070
- /**
2071
- * Gets the list of public archived threads for a channel.
2072
- *
2073
- * @param channelId - The ID of the channel to get the archived threads for.
2074
- * @param options - The parameters for the fetching of threads.
2075
- * @returns An instance of {@link DiscordListArchivedThreads}.
2076
- *
2077
- * @remarks
2078
- * Requires the `READ_MESSAGE_HISTORY` permission.
2079
- *
2080
- * If called on a channel of type {@link ChannelTypes}.GuildText, returns threads of type {@link ChannelTypes}.GuildPublicThread.
2081
- * If called on a channel of type {@link ChannelTypes}.GuildNews, returns threads of type {@link ChannelTypes}.GuildNewsThread.
2082
- *
2083
- * Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
2084
- *
2085
- * @see {@link https://docs.discord.com/developers/resources/channel#list-public-archived-threads}
2086
- */
2087
- getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
2088
- /**
2089
- * Gets the list of roles for a guild.
2090
- *
2091
- * @param guildId - The ID of the guild to get the list of roles for.
2092
- * @returns A collection of {@link DiscordRole} objects assorted by role ID.
2093
- *
2094
- * @remarks
2095
- * ⚠️ This endpoint should be used sparingly due to {@link DiscordRole} objects already being included in guild payloads.
2096
- *
2097
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-roles}
2098
- */
2099
- getRoles: (guildId: BigString) => Promise<Camelize<DiscordRole>[]>;
2100
- /**
2101
- * Gets a role by id for a guild.
2102
- *
2103
- * @param guildId - The ID of the guild to get role for.
2104
- * @param roleId - The ID of the role.
2105
- * @returns A {@link DiscordRole} object.
2106
- *
2107
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role}
2108
- */
2109
- getRole: (guildId: BigString, roleId: BigString) => Promise<Camelize<DiscordRole>>;
2110
- /**
2111
- * Gets a scheduled event by its ID.
2112
- *
2113
- * @param guildId - The ID of the guild to get the scheduled event from.
2114
- * @param eventId - The ID of the scheduled event to get.
2115
- * @param options - The parameters for the fetching of the scheduled event.
2116
- * @returns An instance of {@link DiscordScheduledEvent}.
2117
- *
2118
- * @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#get-guild-scheduled-event}
2119
- */
2120
- getScheduledEvent: (guildId: BigString, eventId: BigString, options?: {
2121
- withUserCount?: boolean;
2122
- }) => Promise<Camelize<DiscordScheduledEvent>>;
2123
- /**
2124
- * Gets the list of scheduled events for a guild.
2125
- *
2126
- * @param guildId - The ID of the guild to get the scheduled events from.
2127
- * @param options - The parameters for the fetching of the scheduled events.
2128
- * @returns A collection of {@link DiscordScheduledEvent} objects assorted by event ID.
2129
- *
2130
- * @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#list-scheduled-events-for-guild}
2131
- */
2132
- getScheduledEvents: (guildId: BigString, options?: GetScheduledEvents) => Promise<Camelize<DiscordScheduledEvent>[]>;
2133
- /**
2134
- * Gets the list of subscribers to a scheduled event from a guild.
2135
- *
2136
- * @param guildId - The ID of the guild to get the subscribers to the scheduled event from.
2137
- * @param eventId - The ID of the scheduled event to get the subscribers of.
2138
- * @param options - The parameters for the fetching of the subscribers.
2139
- * @returns A collection of {@link DiscordUser} objects assorted by user ID.
2140
- *
2141
- * @remarks
2142
- * Requires the `MANAGE_EVENTS` permission.
2143
- *
2144
- * Users are ordered by their IDs in _ascending_ order.
2145
- *
2146
- * @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#get-guild-scheduled-event-users}
2147
- */
2148
- getScheduledEventUsers: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
2149
- user: Camelize<DiscordUser>;
2150
- member?: Camelize<DiscordMember>;
2151
- }>>;
2152
- /** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
2153
- getSessionInfo: () => Promise<Camelize<DiscordGetGatewayBot>>;
2154
- /**
2155
- * Gets the stage instance associated with a stage channel, if one exists.
2156
- *
2157
- * @param channelId - The ID of the stage channel the stage instance is associated with.
2158
- * @returns An instance of {@link DiscordStageInstance}.
2159
- *
2160
- * @see {@link https://docs.discord.com/developers/resources/stage-instance#get-stage-instance}
2161
- */
2162
- getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
2163
- /**
2164
- * Returns the current user's voice state in the guild.
2165
- *
2166
- * @param guildId - The ID of the guild to get the voice state from.
2167
- * @returns An instance of {@link DiscordVoiceState}.
2168
- *
2169
- * @see {@link https://docs.discord.com/developers/resources/voice#get-current-user-voice-state}
2170
- */
2171
- getOwnVoiceState: (guildId: BigString) => Promise<Camelize<DiscordVoiceState>>;
2172
- /**
2173
- * Returns the specified user's voice state in the guild.
2174
- *
2175
- * @param guildId - The ID of the guild to get the voice state from.
2176
- * @param userId - The ID of the user to get the voice state from
2177
- * @returns An instance of {@link DiscordVoiceState}.
2178
- *
2179
- * @remarks
2180
- * If the specified user is connected to a voice channel, the current user must have permission to connect to the channel.
2181
- *
2182
- * @see {@link https://docs.discord.com/developers/resources/voice#get-user-voice-state}
2183
- */
2184
- getUserVoiceState: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordVoiceState>>;
2185
- /**
2186
- * Returns a sticker object for the given sticker ID.
2187
- *
2188
- * @param stickerId The ID of the sticker to get
2189
- * @returns A {@link DiscordSticker}
2190
- *
2191
- * @see {@link https://docs.discord.com/developers/resources/sticker#get-sticker}
2192
- */
2193
- getSticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
2194
- /**
2195
- * Gets a thread member by their user ID.
2196
- *
2197
- * @param channelId - The ID of the thread to get the thread member of.
2198
- * @param userId - The user ID of the thread member to get.
2199
- * @param options - The parameters for the fetching of the thread member.
2200
- * @returns An instance of {@link DiscordThreadMember}.
2201
- *
2202
- * @see {@link https://docs.discord.com/developers/resources/channel#get-thread-member}
2203
- */
2204
- getThreadMember: (channelId: BigString, userId: BigString, options?: GetThreadMember) => Promise<Camelize<DiscordThreadMember>>;
2205
- /**
2206
- * Gets the list of thread members for a thread.
2207
- *
2208
- * @param channelId - The ID of the thread to get the thread members of.
2209
- * @param options - The parameters for the fetching of the thread members.
2210
- * @returns A collection of {@link DiscordThreadMember} assorted by user ID.
2211
- *
2212
- * @remarks
2213
- * Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
2214
- *
2215
- * @see {@link https://docs.discord.com/developers/resources/channel#list-thread-members}
2216
- */
2217
- getThreadMembers: (channelId: BigString, options?: ListThreadMembers) => Promise<Camelize<DiscordThreadMember>[]>;
2218
- /**
2219
- * Gets the list of users that reacted with an emoji to a message.
2220
- *
2221
- * @param channelId - The ID of the channel the message to get the users for is in.
2222
- * @param messageId - The ID of the message to get the users for.
2223
- * @param reaction - The reaction for which to get the users.
2224
- * @param options - The parameters for the fetching of the users.
2225
- * @returns A collection of {@link DiscordUser} objects assorted by user ID.
2226
- *
2227
- * @see {@link https://docs.discord.com/developers/resources/channel#get-reactions}
2228
- */
2229
- getReactions: (channelId: BigString, messageId: BigString, reaction: string, options?: GetReactions) => Promise<Camelize<DiscordUser>[]>;
2230
- /**
2231
- * Get a user's data from the api
2232
- *
2233
- * @param id The user's id
2234
- * @returns {DiscordUser}
2235
- */
2236
- getUser: (id: BigString) => Promise<Camelize<DiscordUser>>;
2237
- /**
2238
- * Get the current user data.
2239
- *
2240
- * @param bearerToken - The access token of the user
2241
- * @returns {DiscordUser}
2242
- *
2243
- * @remarks
2244
- * This requires the `identify` scope.
2245
- *
2246
- * To get the mail this also requires the `email` scope
2247
- */
2248
- getCurrentUser: (bearerToken: string) => Promise<Camelize<DiscordUser>>;
2249
- /**
2250
- * Get the current user connections.
2251
- *
2252
- * @param bearerToken - The access token of the user
2253
- * @returns {DiscordConnection[]}
2254
- *
2255
- * @remarks
2256
- * This requires the `connections` scope.
2257
- */
2258
- getUserConnections: (bearerToken: string) => Promise<Camelize<DiscordConnection>[]>;
2259
- /**
2260
- * Get the current user application role connection for the application.
2261
- *
2262
- * @param bearerToken - The access token of the user
2263
- * @param applicationId - The id of the application to get the role connection
2264
- * @returns {DiscordApplicationRoleConnection}
2265
- *
2266
- * @remarks
2267
- * The access token requires the `role_connections.write` scope.
2268
- *
2269
- * @see {@link https://docs.discord.com/developers/resources/user#get-user-application-role-connection}
2270
- */
2271
- getUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString) => Promise<Camelize<DiscordApplicationRoleConnection>>;
2272
- /**
2273
- * Gets information about the vanity url of a guild.
2274
- *
2275
- * @param guildId - The ID of the guild to get the vanity url information for.
2276
- * @returns An instance of {@link DiscordVanityUrl}.
2277
- *
2278
- * @remarks
2279
- * Requires the `MANAGE_GUILD` permission.
2280
- *
2281
- * The `code` property will be `null` if the guild does not have a set vanity url.
2282
- *
2283
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-vanity-url}
2284
- */
2285
- getVanityUrl: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
2286
- /**
2287
- * Gets the list of voice regions for a guild.
2288
- *
2289
- * @param guildId - The ID of the guild to get the voice regions for.
2290
- * @returns A collection of {@link DiscordVoiceRegion} objects assorted by voice region ID.
2291
- *
2292
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-voice-regions}
2293
- */
2294
- getVoiceRegions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion>[]>;
2295
- /**
2296
- * Gets a webhook by its ID.
2297
- *
2298
- * @param webhookId - The ID of the webhook to get.
2299
- * @returns An instance of {@link DiscordWebhook}.
2300
- *
2301
- * @remarks
2302
- * Requires the `MANAGE_WEBHOOKS` permission unless the application making the request owns the webhook.
2303
- *
2304
- * @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook}
2305
- */
2306
- getWebhook: (webhookId: BigString) => Promise<Camelize<DiscordWebhook>>;
2307
- /**
2308
- * Gets a webhook message by its ID.
2309
- *
2310
- * @param webhookId - The ID of the webhook to get a message of.
2311
- * @param token - The webhook token, used to get webhook messages.
2312
- * @param messageId - the ID of the webhook message to get.
2313
- * @param options - The parameters for the fetching of the message.
2314
- * @returns An instance of {@link DiscordMessage}.
2315
- *
2316
- * @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook-message}
2317
- */
2318
- getWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
2319
- /**
2320
- * Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
2321
- *
2322
- * @param webhookId - The ID of the webhook to get.
2323
- * @param token - The webhook token, used to get the webhook.
2324
- * @returns An instance of {@link DiscordWebhook}.
2325
- *
2326
- * @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook-with-token}
2327
- */
2328
- getWebhookWithToken: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
2329
- /**
2330
- * Gets the welcome screen for a guild.
2331
- *
2332
- * @param guildId - The ID of the guild to get the welcome screen for.
2333
- * @returns An instance of {@link DiscordWelcomeScreen}.
2334
- *
2335
- * @remarks
2336
- * If the welcome screen is not enabled:
2337
- * - Requires the `MANAGE_GUILD` permission.
2338
- *
2339
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-welcome-screen}
2340
- */
2341
- getWelcomeScreen: (guildId: BigString) => Promise<Camelize<DiscordWelcomeScreen>>;
2342
- /**
2343
- * Gets the guild widget by guild ID.
2344
- *
2345
- * @param guildId - The ID of the guild to get the widget of.
2346
- * @returns An instance of {@link DiscordGuildWidget}.
2347
- *
2348
- * @remarks
2349
- * Fires an `INVITE_CREATED` Gateway event when an invite channel is defined and a new `Invite` is generated.
2350
- *
2351
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-widget}
2352
- */
2353
- getWidget: (guildId: BigString) => Promise<Camelize<DiscordGuildWidget>>;
2354
- /**
2355
- * Gets the settings of a guild's widget.
2356
- *
2357
- * @param guildId - The ID of the guild to get the widget of.
2358
- * @returns An instance of {@link DiscordGuildWidgetSettings}.
2359
- *
2360
- * @remarks
2361
- * Requires the `MANAGE_GUILD` permission.
2362
- *
2363
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-widget-settings}
2364
- */
2365
- getWidgetSettings: (guildId: BigString) => Promise<Camelize<DiscordGuildWidgetSettings>>;
2366
- /**
2367
- * Adds the bot user to a thread.
2368
- *
2369
- * @param channelId - The ID of the thread to add the bot user to.
2370
- *
2371
- * @remarks
2372
- * Requires the thread not be archived.
2373
- *
2374
- * Fires a _Thread Members Update_ gateway event.
2375
- *
2376
- * @see {@link https://docs.discord.com/developers/resources/channel#join-thread}
2377
- */
2378
- joinThread: (channelId: BigString) => Promise<void>;
2379
- /**
2380
- * Leaves a guild.
2381
- *
2382
- * @param guildId - The ID of the guild to leave.
2383
- *
2384
- * @remarks
2385
- * Fires a _Guild Delete_ event.
2386
- *
2387
- * @see {@link https://docs.discord.com/developers/resources/user#leave-guild}
2388
- */
2389
- leaveGuild: (guildId: BigString) => Promise<void>;
2390
- /**
2391
- * Removes the bot user from a thread.
2392
- *
2393
- * @param channelId - The ID of the thread to remove the bot user from.
2394
- *
2395
- * @remarks
2396
- * Requires the thread not be archived.
2397
- *
2398
- * Fires a _Thread Members Update_ gateway event.
2399
- *
2400
- * @see {@link https://docs.discord.com/developers/resources/channel#leave-thread}
2401
- */
2402
- leaveThread: (channelId: BigString) => Promise<void>;
2403
- /**
2404
- * Cross-posts a message posted in an announcement channel to subscribed channels.
2405
- *
2406
- * @param channelId - The ID of the announcement channel.
2407
- * @param messageId - The ID of the message to cross-post.
2408
- * @returns An instance of the cross-posted {@link DiscordMessage}.
2409
- *
2410
- * @remarks
2411
- * Requires the `SEND_MESSAGES` permission.
2412
- *
2413
- * If not cross-posting own message:
2414
- * - Requires the `MANAGE_MESSAGES` permission.
2415
- *
2416
- * Fires a _Message Create_ event in the guilds the subscribed channels are in.
2417
- *
2418
- * @see {@link https://docs.discord.com/developers/resources/channel#crosspost-message}
2419
- */
2420
- publishMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
2421
- /**
2422
- * Removes a role from a member.
2423
- *
2424
- * @param guildId - The ID of the guild the member to remove the role from is in.
2425
- * @param userId - The user ID of the member to remove the role from.
2426
- * @param roleId - The ID of the role to remove from the member.
2427
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2428
- *
2429
- * @remarks
2430
- * Requires the `MANAGE_ROLES` permission.
2431
- *
2432
- * Fires a _Guild Member Update_ gateway event.
2433
- *
2434
- * @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-member-role}
2435
- */
2436
- removeRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
2437
- /**
2438
- * Removes a member from a thread.
2439
- *
2440
- * @param channelId - The ID of the thread to remove the thread member of.
2441
- * @param userId - The user ID of the thread member to remove.
2442
- *
2443
- * @remarks
2444
- * If the thread is of type {@link ChannelTypes}.GuildPrivateThread, requires to be the creator of the thread.
2445
- * Otherwise, requires the `MANAGE_THREADS` permission.
2446
- *
2447
- * Requires the thread not be archived.
2448
- *
2449
- * Fires a _Thread Members Update_ gateway event.
2450
- *
2451
- * @see {@link https://docs.discord.com/developers/resources/channel#remove-thread-member}
2452
- */
2453
- removeThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
2454
- /**
2455
- * Removes a member from a Group DM.
2456
- *
2457
- * @param channelId - The ID of the channel to remove the recipient user of.
2458
- * @param userId - The user ID of the user to remove.
2459
- *
2460
- * @see {@link https://docs.discord.com/developers/resources/channel#group-dm-remove-recipient}
2461
- */
2462
- removeDmRecipient: (channelId: BigString, userId: BigString) => Promise<void>;
2463
- /**
2464
- * Sends a message to a channel.
2465
- *
2466
- * @param channelId - The ID of the channel to send the message in.
2467
- * @param options - The parameters for the creation of the message.
2468
- * @returns An instance of the created {@link DiscordMessage}.
2469
- *
2470
- * @remarks
2471
- * Requires that the bot user be able to see the contents of the channel the message is to be sent in.
2472
- *
2473
- * If sending a message to a guild channel:
2474
- * - Requires the `SEND_MESSAGES` permission.
2475
- *
2476
- * If sending a TTS message:
2477
- * - Requires the `SEND_TTS_MESSAGES` permission.
2478
- *
2479
- * If sending a message as a reply to another message:
2480
- * - Requires the `READ_MESSAGE_HISTORY` permission.
2481
- * - The message being replied to cannot be a system message.
2482
- *
2483
- * ⚠️ The maximum size of a request (accounting for any attachments and message content) for bot users is _8 MiB_.
2484
- *
2485
- * Fires a _Message Create_ gateway event.
2486
- *
2487
- * @see {@link https://docs.discord.com/developers/resources/channel#create-message}
2488
- */
2489
- sendMessage: (channelId: BigString, options: CreateMessageOptions) => Promise<Camelize<DiscordMessage>>;
2490
- /**
2491
- * Sends a follow-up message to an interaction.
2492
- *
2493
- * @param token - The interaction token to use, provided in the original interaction.
2494
- * @param options - The parameters for the creation of the message.
2495
- * @returns An instance of the created {@link DiscordMessage}.
2496
- *
2497
- * @remarks
2498
- * ⚠️ Interaction tokens are only valid for _15 minutes_.
2499
- *
2500
- * By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
2501
- *
2502
- * Unlike `sendMessage()`, this endpoint allows the bot user to act without:
2503
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
2504
- * - Requiring the `MESSAGE_CONTENT` intent.
2505
- *
2506
- * Apps are limited to 5 followup messages per interaction if it was initiated from a user-installed app and isn't installed in the server
2507
- * You can check if it was initiated from a user-installed app that isn't installed in the server by checking if {@link DiscordInteraction.authorizing_integration_owners | authorizingIntegrationOwners} only contains {@link DiscordApplicationIntegrationType.UserInstall | UserInstall}.
2508
- *
2509
- * Fires a _Message Create_ event.
2510
- *
2511
- * @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#create-followup-message}
2512
- */
2513
- sendFollowupMessage: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
2514
- /**
2515
- * Sends a response to an interaction.
2516
- *
2517
- * @param interactionId - The ID of the interaction to respond to.
2518
- * @param token - The interaction token to use, provided in the original interaction.
2519
- * @param options - The parameters for the creation of the message.
2520
- * @param params - The query parameters for the response of the callback
2521
- * @returns Nothing or the {@link DiscordInteractionCallbackResponse} if withResponse param is true
2522
- *
2523
- * @remarks
2524
- * ⚠️ Interaction tokens are only valid for _15 minutes_.
2525
- *
2526
- * By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
2527
- *
2528
- * Unlike `sendMessage()`, this endpoint allows the bot user to act without:
2529
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
2530
- * - Requiring the `MESSAGE_CONTENT` intent.
2531
- *
2532
- * Fires a _Message Create_ event.
2533
- *
2534
- * @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#create-interaction-response}
2535
- */
2536
- sendInteractionResponse: (interactionId: BigString, token: string, options: InteractionResponse, params?: InteractionCallbackOptions) => Promise<void | Camelize<DiscordInteractionCallbackResponse>>;
2537
- /**
2538
- * Creates a thread, using an existing message as its point of origin.
2539
- *
2540
- * @param channelId - The ID of the channel in which to create the thread.
2541
- * @param messageId - The ID of the message to use as the thread's point of origin.
2542
- * @param options - The parameters to use for the creation of the thread.
2543
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2544
- * @returns An instance of the created {@link DiscordChannel}.
2545
- *
2546
- * @remarks
2547
- * If called on a channel of type {@link ChannelTypes}.GuildText, creates a {@link ChannelTypes}.GuildPublicThread.
2548
- * If called on a channel of type {@link ChannelTypes}.GuildNews, creates a {@link ChannelTypes}.GuildNewsThread.
2549
- * Does not work on channels of type {@link ChannelTypes}.GuildForum.
2550
- *
2551
- * The ID of the created thread will be the same as the ID of the source message.
2552
- *
2553
- * Fires a _Thread Create_ gateway event.
2554
- *
2555
- * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message}
2556
- */
2557
- startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage, reason?: string) => Promise<Camelize<DiscordChannel>>;
2558
- /**
2559
- * Creates a thread without using a message as the thread's point of origin.
2560
- *
2561
- * @param channelId - The ID of the channel in which to create the thread.
2562
- * @param options - The parameters to use for the creation of the thread.
2563
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2564
- * @returns An instance of the created {@link DiscordChannel | Thread}.
2565
- *
2566
- * @remarks
2567
- * Creating a private thread requires the server to be boosted.
2568
- *
2569
- * Fires a _Thread Create_ gateway event.
2570
- *
2571
- * @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message}
2572
- */
2573
- startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage, reason?: string) => Promise<Camelize<DiscordChannel>>;
2574
- /**
2575
- * Get a list of users that voted for this specific answer.
2576
- *
2577
- * @param channelId - The ID of the channel in which the message with the poll lives
2578
- * @param messageId - The ID of the message in which the poll lives
2579
- * @param answerId - The ID of the answer to get the users that voted that answer
2580
- * @param options - The options for the request
2581
- * @returns The list of users that voted for the specific answer.
2582
- */
2583
- getPollAnswerVoters: (channelId: BigString, messageId: BigString, answerId: number, options?: GetPollAnswerVotes) => Promise<Camelize<DiscordGetAnswerVotesResponse>>;
2584
- /**
2585
- * Immediately ends the poll.
2586
- *
2587
- * @param channelId - The ID of the channel in which the message with the poll lives
2588
- * @param messageId - The ID of the message in which the poll lives
2589
- * @returns The message with the expired poll
2590
- *
2591
- * @remarks
2592
- * You cannot end polls from other users.
2593
- *
2594
- * Fires a _Message Update_ gateway event
2595
- */
2596
- endPoll: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
2597
- /**
2598
- * Synchronises a template with the current state of a guild.
2599
- *
2600
- * @param guildId - The ID of the guild to synchronise a template of.
2601
- * @returns An instance of the edited {@link DiscordTemplate}.
2602
- *
2603
- * @remarks
2604
- * Requires the `MANAGE_GUILD` permission.
2605
- *
2606
- * Fires a _Guild Update_ gateway event.
2607
- *
2608
- * @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-templates}
2609
- */
2610
- syncGuildTemplate: (guildId: BigString) => Promise<Camelize<DiscordTemplate>>;
2611
- /**
2612
- * Triggers a typing indicator for the specified channel, which expires after 10 seconds.
2613
- *
2614
- * @param channelId - The ID of the channel in which to trigger the typing indicator.
2615
- *
2616
- * @remarks
2617
- * Generally bots should **not** use this route.
2618
- * However, if a bot is responding to a command and expects the computation to take a few seconds,
2619
- * this endpoint may be called to let the user know that the bot is processing their message.
2620
- *
2621
- * Fires a _Typing Start_ gateway event.
2622
- *
2623
- * @see {@link https://docs.discord.com/developers/resources/channel#trigger-typing-indicator}
2624
- */
2625
- triggerTypingIndicator: (channelId: BigString) => Promise<void>;
2626
- /**
2627
- * Re-registers the list of global application commands, overwriting the previous commands completely.
2628
- *
2629
- * @param commands - The list of commands to use to overwrite the previous list.
2630
- * @param options - Additional options for the endpoint.
2631
- * @returns A collection of {@link DiscordApplicationCommand} objects assorted by command ID.
2632
- *
2633
- * @remarks
2634
- * ❗ Commands that are not present in the `commands` array will be __deleted__.
2635
- *
2636
- * ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
2637
- *
2638
- * When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
2639
- * You will be able to update only your own application commands
2640
- *
2641
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#bulk-overwrite-global-application-commands}
2642
- */
2643
- upsertGlobalApplicationCommands: (commands: CreateApplicationCommand[], options?: UpsertGlobalApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
2644
- /**
2645
- * Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.
2646
- *
2647
- * @param guildId - The ID of the guild whose list of commands to overwrite.
2648
- * @param commands - The list of commands to use to overwrite the previous list.
2649
- * @param options - Additional options for the endpoint.
2650
- * @returns A collection of {@link DiscordApplicationCommand} objects assorted by command ID.
2651
- *
2652
- * @remarks
2653
- * ❗ Commands that are not present in the `commands` array will be __deleted__.
2654
- *
2655
- * ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
2656
- *
2657
- * When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
2658
- * You will be able to update only your own application commands
2659
- *
2660
- * @see {@link https://docs.discord.com/developers/interactions/application-commands#bulk-overwrite-guild-application-commands}
2661
- */
2662
- upsertGuildApplicationCommands: (guildId: BigString, commands: CreateApplicationCommand[], options?: UpsertGuildApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
2663
- /**
2664
- * Bans a user from a guild.
2665
- *
2666
- * @param guildId - The ID of the guild to ban the user from.
2667
- * @param userId - The ID of the user to ban from the guild.
2668
- * @param options - The parameters for the creation of the ban.
2669
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2670
- *
2671
- * @remarks
2672
- * Requires the `BAN_MEMBERS` permission.
2673
- *
2674
- * Fires a _Guild Ban Add_ gateway event.
2675
- *
2676
- * @see {@link https://docs.discord.com/developers/resources/guild#create-guild-ban}
2677
- */
2678
- banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan, reason?: string) => Promise<void>;
2679
- /**
2680
- * Bans up to 200 users from a guild.
2681
- *
2682
- * @param guildId - The ID of the guild to ban the users from.
2683
- * @param options - The users to ban and the other options for the ban.
2684
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2685
- *
2686
- * @remarks
2687
- * Requires the `BAN_MEMBERS` and `MANAGE_GUILD` permissions.
2688
- *
2689
- * If all provided users fail to be banned, discord will respond with an error (code: `500000: Failed to ban users`)
2690
- *
2691
- * Fires as many _Guild Ban Add_ gateway events as many user where banned.
2692
- *
2693
- * @see {@link https://docs.discord.com/developers/resources/guild#bulk-guild-ban}
2694
- */
2695
- bulkBanMembers: (guildId: BigString, options: CreateGuildBulkBan, reason?: string) => Promise<Camelize<DiscordBulkBan>>;
2696
- /**
2697
- * Edits the nickname of the bot user.
2698
- *
2699
- * @param guildId - The ID of the guild to edit the nickname of the bot user in.
2700
- * @param options - The parameters for the edit of the nickname.
2701
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2702
- * @returns An instance of the edited {@link DiscordMember}
2703
- *
2704
- * @remarks
2705
- * Fires a _Guild Member Update_ gateway event.
2706
- *
2707
- * @see {@link https://docs.discord.com/developers/resources/guild#modify-current-member}
2708
- */
2709
- editCurrentMember: (guildId: BigString, options: ModifyCurrentMember, reason?: string) => Promise<Camelize<DiscordMember>>;
2710
- /**
2711
- * Edits a member's properties.
2712
- *
2713
- * @param guildId - The ID of the guild to edit the member of.
2714
- * @param userId - The user ID of the member to edit.
2715
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2716
- * @param options - The parameters for the edit of the user.
2717
- *
2718
- * @remarks
2719
- * This endpoint requires various permissions depending on what is edited about the member.
2720
- * To find out the required permission to enact a change, read the documentation of this endpoint's {@link ModifyGuildMember | parameters}.
2721
- *
2722
- * Fires a _Guild Member Update_ gateway event.
2723
- *
2724
- * @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-member}
2725
- */
2726
- editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember, reason?: string) => Promise<Camelize<DiscordMember>>;
2727
- /**
2728
- * Gets the current member object.
2729
- *
2730
- * @param bearerToken - The access token of the user
2731
- * @param guildId - The ID of the guild to get the member object for.
2732
- * @returns An instance of {@link DiscordMemberWithUser}.
2733
- *
2734
- * @remarks
2735
- * The access tokens needs the `guilds.members.read` scope
2736
- *
2737
- * @see {@link https://docs.discord.com/developers/resources/user#get-current-user-guild-member}
2738
- */
2739
- getCurrentMember: (guildId: BigString, bearerToken: string) => Promise<Camelize<DiscordMemberWithUser>>;
2740
- /**
2741
- * Gets the member object by user ID.
2742
- *
2743
-
2744
- * @param guildId - The ID of the guild to get the member object for.
2745
- * @param userId - The ID of the user to get the member object for.
2746
- * @returns An instance of {@link DiscordMemberWithUser}.
2747
- *
2748
- * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-member}
2749
- */
2750
- getMember: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
2751
- /**
2752
- * Gets the list of members for a guild.
2753
- *
2754
- * @param guildId - The ID of the guild to get the list of members for.
2755
- * @param options - The parameters for the fetching of the members.
2756
- * @returns A collection of {@link DiscordMemberWithUser} objects assorted by user ID.
2757
- *
2758
- * @remarks
2759
- * Requires the `GUILD_MEMBERS` intent.
2760
- *
2761
- * ⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use `fetchMembers()`:
2762
- * REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
2763
- * per minute per shard. For more information, read {@link https://docs.discord.com/developers/topics/rate-limits#rate-limits}.
2764
- *
2765
- * @see {@link https://docs.discord.com/developers/resources/guild#list-guild-members}
2766
- * @see {@link https://docs.discord.com/developers/events/gateway-events#request-guild-members}
2767
- * @see {@link https://docs.discord.com/developers/topics/rate-limits#rate-limits}
2768
- */
2769
- getMembers: (guildId: BigString, options: ListGuildMembers) => Promise<Camelize<DiscordMemberWithUser>[]>;
2770
- /**
2771
- * Returns a serialized activity instance, if it exists. Useful for preventing unwanted activity sessions.
2772
- *
2773
- * @param applicationId - The ID of the application
2774
- * @param instanceId - The ID of the activity instance
2775
- */
2776
- getApplicationActivityInstance: (applicationId: BigString, instanceId: string) => Promise<Camelize<DiscordActivityInstance>>;
2777
- /**
2778
- * Kicks a member from a guild.
2779
- *
2780
-
2781
- * @param guildId - The ID of the guild to kick the member from.
2782
- * @param userId - The user ID of the member to kick from the guild.
2783
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2784
- *
2785
- * @remarks
2786
- * Requires the `KICK_MEMBERS` permission.
2787
- *
2788
- * Fires a _Guild Member Remove_ gateway event.
2789
- *
2790
- * @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-member}
2791
- */
2792
- kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
2793
- /**
2794
- * Pins a message in a channel.
2795
- *
2796
- * @param channelId - The ID of the channel where the message is to be pinned.
2797
- * @param messageId - The ID of the message to pin.
2798
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2799
- *
2800
- * @remarks
2801
- * Requires the `PIN_MESSAGES` permission.
2802
- *
2803
- * Fires a _Channel Pins Update_ event.
2804
- *
2805
- * @see {@link https://docs.discord.com/developers/resources/message#pin-message}
2806
- */
2807
- pinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
2808
- /**
2809
- * Initiates the process of pruning inactive members.
2810
- *
2811
-
2812
- * @param guildId - The ID of the guild to prune the members of.
2813
- * @param options - The parameters for the pruning of members.
2814
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2815
- * @returns A number indicating how many members were pruned.
2816
- *
2817
- * @remarks
2818
- * Requires the `MANAGE_GUILD` and `KICK_MEMBERS` permissions.
2819
- *
2820
- * ❗ Requests to this endpoint will time out for large guilds. To prevent this from happening, set the {@link BeginGuildPrune.computePruneCount} property of the options object parameter to `false`. This will begin the process of pruning, and immediately return `undefined`, rather than wait for the process to complete before returning the actual count of members that have been kicked.
2821
- *
2822
- * ⚠️ By default, this process will not remove members with a role. To include the members who have a _particular subset of roles_, specify the role(s) in the {@link BeginGuildPrune.includeRoles | includeRoles} property of the options object parameter.
2823
- *
2824
- * Fires a _Guild Member Remove_ gateway event for every member kicked.
2825
- *
2826
- * @see {@link https://docs.discord.com/developers/resources/guild#begin-guild-prune}
2827
- */
2828
- pruneMembers: (guildId: BigString, options: BeginGuildPrune, reason?: string) => Promise<{
2829
- pruned: number | null;
2830
- }>;
2831
- /**
2832
- * Gets the list of members whose usernames or nicknames start with a provided string.
2833
- *
2834
-
2835
- * @param guildId - The ID of the guild to search in.
2836
- * @param query - The string to match usernames or nicknames against.
2837
- * @param options - The parameters for searching through the members.
2838
- * @returns A collection of {@link DiscordMember} objects assorted by user ID.
2839
- *
2840
- * @see {@link https://docs.discord.com/developers/resources/guild#search-guild-members}
2841
- */
2842
- searchMembers: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<Camelize<DiscordMemberWithUser>[]>;
2843
- /**
2844
- * Unbans a user from a guild.
2845
- *
2846
-
2847
- * @param guildId - The ID of the guild to unban the user in.
2848
- * @param userId - The ID of the user to unban.
2849
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2850
- *
2851
- * @remarks
2852
- * Requires the `BAN_MEMBERS` permission.
2853
- *
2854
- * Fires a _Guild Ban Remove_ gateway event.
2855
- *
2856
- * @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-ban}
2857
- */
2858
- unbanMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
2859
- /**
2860
- * Unpin a message in a channel.
2861
- *
2862
- * @param channelId - The ID of the channel where the message is pinned.
2863
- * @param messageId - The ID of the message to unpin.
2864
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2865
- *
2866
- * @remarks
2867
- * Requires the `PIN_MESSAGES` permission.
2868
- *
2869
- * Fires a _Channel Pins Update_ event.
2870
- *
2871
- * @see {@link https://docs.discord.com/developers/resources/message#unpin-message}
2872
- */
2873
- unpinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
2874
- /**
2875
- * Get the guild onboarding
2876
- *
2877
- * @param guildId - The guild to get the onboarding from
2878
- */
2879
- getGuildOnboarding: (guildId: BigString) => Promise<Camelize<DiscordGuildOnboarding>>;
2880
- /**
2881
- * Modifies the onboarding configuration of the guild.
2882
- *
2883
- * @param guildId - The guild to edit the onboarding from
2884
- * @param {string} [reason] - An optional reason for the action, to be included in the audit log.
2885
- *
2886
- * @remarks
2887
- * Requires the `MANAGE_GUILD` and `MANAGE_ROLES` permissions.
2888
- *
2889
- * Onboarding enforces constraints when enabled. These constraints are:
2890
- * - at least 7 default channels
2891
- * - at least 5 of the 7 channels must allow sending messages to the \@everyone role
2892
- *
2893
- * The `mode` field modifies what is considered when enforcing these constraints.
2894
- */
2895
- editGuildOnboarding: (guildId: BigString, options: EditGuildOnboarding, reason?: string) => Promise<Camelize<DiscordGuildOnboarding>>;
2896
- /**
2897
- * Modifies the incident actions of the guild.
2898
- *
2899
- * @param guildId - The guild to edit the incident actions from
2900
- * @param options - The options for the incident actions
2901
- *
2902
- * @remarks
2903
- * Requires the `MANAGE_GUILD` permission.
2904
- */
2905
- modifyGuildIncidentActions: (guildId: BigString, options: ModifyGuildIncidentActions) => Promise<Camelize<DiscordIncidentsData>>;
2906
- /**
2907
- * Returns all entitlements for a given app, active and expired.
2908
- *
2909
- * @param applicationId - The id of the application to get the entitlements
2910
- * @param {GetEntitlements} [options] - The optional query params for the endpoint
2911
- */
2912
- listEntitlements: (applicationId: BigString, options?: GetEntitlements) => Promise<Camelize<DiscordEntitlement>[]>;
2913
- /**
2914
- * Returns an entitlement.
2915
- *
2916
- * @param applicationId - The id of the application to get the entitlement
2917
- * @param entitlementId - The id of the entitlement to get
2918
- */
2919
- getEntitlement: (applicationId: BigString, entitlementId: BigString) => Promise<Camelize<DiscordEntitlement>>;
2920
- /**
2921
- * Creates a test entitlement to a given SKU for a given guild or user. Discord will act as though that user or guild has entitlement to your premium offering.
2922
- *
2923
- * @param applicationId - The id of the application to create the entitlement
2924
- * @param body - The options for new entitlement
2925
- *
2926
- * @remarks
2927
- * This endpoint returns a partial entitlement object.
2928
- * It will not contain subscription_id, starts_at, or ends_at, as it's valid in perpetuity.
2929
- */
2930
- createTestEntitlement: (applicationId: BigString, body: CreateTestEntitlement) => Promise<Partial<Camelize<DiscordEntitlement>>>;
2931
- /**
2932
- * Deletes a currently-active test entitlement. Discord will act as though that user or guild no longer has entitlement to your premium offering.
2933
- *
2934
- * @param applicationId - The id of the application from where delete the entitlement
2935
- * @param entitlementId - The id of the entitlement to delete
2936
- */
2937
- deleteTestEntitlement: (applicationId: BigString, entitlementId: BigString) => Promise<void>;
2938
- /**
2939
- * For One-Time Purchase consumable SKUs, marks a given entitlement for the user as consumed. The entitlement will have `consumed: true` when using {@link listEntitlements | List Entitlements}
2940
- *
2941
- * @param applicationId - The id of the application to get the entitlement
2942
- * @param entitlementId - The id of the entitlement to get
2943
- */
2944
- consumeEntitlement: (applicationId: BigString, entitlementId: BigString) => Promise<void>;
2945
- /**
2946
- * Returns all SKUs for a given application
2947
- *
2948
- * @param applicationId - The id of the application to get the SKUs
2949
- */
2950
- listSkus: (applicationId: BigString) => Promise<Camelize<DiscordSku>[]>;
2951
- /**
2952
- * Returns all subscriptions containing the SKU, filtered by user.
2953
- *
2954
- * @param skuId - The id of the sku of get the subscriptions for
2955
- */
2956
- listSubscriptions: (skuId: BigString, options?: ListSkuSubscriptionsOptions) => Promise<Camelize<DiscordSubscription[]>>;
2957
- /**
2958
- * Get a subscription by its ID.
2959
- *
2960
- * @param skuId - The id of the sku of get the subscriptions for
2961
- */
2962
- getSubscription: (skuId: BigString, subscriptionId: BigString) => Promise<Camelize<DiscordSubscription>>;
2963
- /**
2964
- * Send a soundboard sound to a voice channel the user is connected to.
2965
- *
2966
- * @param channelId - The id of the voice channel
2967
- *
2968
- * @remarks
2969
- * Fires a _Voice Channel Effect Send_ Gateway event.
2970
- *
2971
- * Requires the `SPEAK` and `USE_SOUNDBOARD` permissions, and also the `USE_EXTERNAL_SOUNDS` permission if the sound is from a different server.
2972
- * Additionally, requires the user to be connected to the voice channel, having a voice state without `deaf`, `self_deaf`, `mute`, or `suppress` enabled.
2973
- */
2974
- sendSoundboardSound: (channelId: BigString, options: SendSoundboardSound) => Promise<void>;
2975
- /** Returns an array of soundboard sound objects that can be used by all users. */
2976
- listDefaultSoundboardSounds: () => Promise<Camelize<DiscordSoundboardSound>[]>;
2977
- /**
2978
- * Returns a list of the guild's soundboard sounds.
2979
- *
2980
- * @param guildId - The guild to get the sounds from
2981
- *
2982
- * @remarks
2983
- * Includes `user` fields if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
2984
- */
2985
- listGuildSoundboardSounds: (guildId: BigString) => Promise<{
2986
- items: Camelize<DiscordSoundboardSound>[];
2987
- }>;
2988
- /**
2989
- * Returns a soundboard sound object for the given sound id.
2990
- *
2991
- * @param guildId - The guild to get the sounds from
2992
- * @param soundId - The sound id
2993
- *
2994
- * @remarks
2995
- * Includes `user` fields if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
2996
- */
2997
- getGuildSoundboardSound: (guildId: BigString, soundId: BigString) => Promise<Camelize<DiscordSoundboardSound>>;
2998
- /**
2999
- * Create a new soundboard sound for the guild.
3000
- *
3001
- * @param guildId - The guild to create the sounds in
3002
- * @param options - The options to create the sound
3003
- * @param reason - The audit log reason
3004
- *
3005
- * @remarks
3006
- * Fires a _Guild Soundboard Sound Create_ Gateway event.
3007
- *
3008
- * Requires the `CREATE_GUILD_EXPRESSIONS` permission.
3009
- */
3010
- createGuildSoundboardSound: (guildId: BigString, options: CreateGuildSoundboardSound, reason?: string) => Promise<Camelize<DiscordSoundboardSound>>;
3011
- /**
3012
- * Modify the given soundboard sound.
3013
- *
3014
- * @param guildId - The guild to create the sounds in
3015
- * @param soundId - The sound id to update
3016
- * @param options - The options to update the sound
3017
- * @param reason - The audit log reason
3018
- *
3019
- * @remarks
3020
- * Fires a _Guild Soundboard Sound Update_ Gateway event.
3021
- *
3022
- * For sounds created by the current user, requires either the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
3023
- * For other sounds, requires the `MANAGE_GUILD_EXPRESSIONS` permission.
3024
- */
3025
- modifyGuildSoundboardSound: (guildId: BigString, soundId: BigString, options: ModifyGuildSoundboardSound, reason?: string) => Promise<Camelize<DiscordSoundboardSound>>;
3026
- /**
3027
- * Delete the given soundboard sound.
3028
- *
3029
- * @param guildId - The guild to create the sounds in
3030
- * @param soundId - The sound id to delete
3031
- * @param reason - The audit log reason
3032
- *
3033
- * @remarks
3034
- * Fires a _Guild Soundboard Sound Delete_ Gateway event.
3035
- *
3036
- * For sounds created by the current user, requires either the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
3037
- * For other sounds, requires the `MANAGE_GUILD_EXPRESSIONS` permission.
3038
- */
3039
- deleteGuildSoundboardSound: (guildId: BigString, soundId: BigString, reason?: string) => Promise<void>;
3040
- /**
3041
- * Returns a list of application role connection metadata objects for the given application.
3042
- *
3043
- * @param applicationId - The application to get the role connections from
3044
- * @returns A list of application role connection metadata objects
3045
- */
3046
- listApplicationRoleConnectionsMetadataRecords: (applicationId: BigString) => Promise<Camelize<DiscordApplicationRoleConnectionMetadata>[]>;
3047
- /**
3048
- * Updates and returns a list of application role connection metadata objects for the given application.
3049
- *
3050
- * @param applicationId - The application to get the role connections from
3051
- * @param options - The options to update the role connections
3052
- * @returns A list of application role connection metadata objects
3053
- *
3054
- * @remarks
3055
- * An application can have a maximum of 5 metadata records.
3056
- */
3057
- updateApplicationRoleConnectionsMetadataRecords: (applicationId: BigString, options: Camelize<DiscordApplicationRoleConnectionMetadata>[]) => Promise<Camelize<DiscordApplicationRoleConnectionMetadata>[]>;
3058
- /**
3059
- * Creates a new lobby, adding any of the specified members to it, if provided.
3060
- *
3061
- * @param options - The options to create the lobby
3062
- * @returns The created lobby
3063
- */
3064
- createLobby: (options: CreateLobby) => Promise<Camelize<DiscordLobby>>;
3065
- /**
3066
- * Creates a new lobby for the application identified by a `secret`, or joins the calling user to the existing lobby with that secret if one already exists.
3067
- *
3068
- * Updates lobby metadata and the calling member's metadata on join.
3069
- *
3070
- * @param options - The options to create or join the lobby
3071
- * @returns - The created or joined lobby
3072
- *
3073
- * @remarks
3074
- * Uses `Bearer` token for authorization with the `sdk.social_layer` scope.
3075
- */
3076
- createOrJoinLobby: (options: CreateOrJoinLobby) => Promise<Camelize<DiscordLobby>>;
3077
- /**
3078
- * Returns a lobby object for the specified lobby id, if it exists.
3079
- *
3080
- * @param lobbyId - The ID of the lobby to get
3081
- * @returns The lobby object
3082
- */
3083
- getLobby: (lobbyId: BigString) => Promise<Camelize<DiscordLobby>>;
3084
- /**
3085
- * Modifies the specified lobby with new values, if provided.
3086
- *
3087
- * @param lobbyId - The ID of the lobby to modify
3088
- * @param options - The options to modify the lobby
3089
- * @returns The modified lobby
3090
- */
3091
- modifyLobby: (lobbyId: BigString, options: ModifyLobby) => Promise<Camelize<DiscordLobby>>;
3092
- /**
3093
- * Deletes the specified lobby if it exists.
3094
- *
3095
- * It is safe to call even if the lobby is already deleted as well.
3096
- *
3097
- * @param lobbyId - The ID of the lobby to delete
3098
- * @returns Nothing
3099
- */
3100
- deleteLobby: (lobbyId: BigString) => Promise<void>;
3101
- /**
3102
- * Adds the provided user to the specified lobby. If called when the user is already a member of the lobby will update fields such as metadata on that user instead.
3103
- *
3104
- * @param lobbyId - The ID of the lobby to add the user to
3105
- * @param userId - The ID of the user to add to the lobby
3106
- * @param options - The options to add the user to the lobby
3107
- * @returns The lobby member object
3108
- */
3109
- addMemberToLobby: (lobbyId: BigString, userId: BigString, options: AddLobbyMember) => Promise<Camelize<DiscordLobbyMember>>;
3110
- /**
3111
- * Adds, updates, or removes up to 25 members from the specified lobby in a single request.
3112
- *
3113
- * @param lobbyId - The ID of the lobby to add, update, or remove members from
3114
- * @param options - The options to add, update, or remove members from the lobby
3115
- * @returns Returns an array of lobby member objects for the upserted members. Removed members are not included in the response.
3116
- *
3117
- * @remarks
3118
- * Members with `remove_member: false` (the default) are upserted — added if not present, or updated with the provided metadata and flags if already a member. Members with `remove_member: true` are removed.
3119
- *
3120
- * Users unknown to Discord will return a 404 UNKNOWN_USER error.
3121
- * Users that fail permission checks or who have already reached the maximum number of lobbies per application (and are not already a member of this lobby) are silently dropped from the upsert set.
3122
- *
3123
- * @see {@link https://docs.discord.com/developers/resources/lobby#bulk-update-lobby-members}
3124
- */
3125
- bulkUpdateLobbyMembers: (lobbyId: BigString, options: BulkUpdateLobbyMember[]) => Promise<Camelize<DiscordLobbyMember>[]>;
3126
- /**
3127
- * Removes the provided user from the specified lobby. It is safe to call this even if the user is no longer a member of the lobby, but will fail if the lobby does not exist.
3128
- *
3129
- * @param lobbyId - The ID of the lobby to remove the user from
3130
- * @param userId - The ID of the user to remove from the lobby
3131
- * @returns Nothing
3132
- */
3133
- removeMemberFromLobby: (lobbyId: BigString, userId: BigString) => Promise<void>;
3134
- /**
3135
- * Removes the current user from the specified lobby. It is safe to call this even if the user is no longer a member of the lobby, but will fail if the lobby does not exist.
3136
- *
3137
- * @param lobbyId - The ID of the lobby to remove the user from
3138
- * @param bearerToken - The access token of the user
3139
- * @returns Nothing
3140
- *
3141
- * @remarks
3142
- * This requires a bearer token for authorization
3143
- */
3144
- leaveLobby: (lobbyId: BigString, bearerToken: string) => Promise<void>;
3145
- /**
3146
- * Links an existing text channel to a lobby.
3147
- *
3148
- * @param lobbyId - The ID of the lobby to link the channel to
3149
- * @param bearerToken - The access token of the user
3150
- * @param options - The options to link the channel to the lobby
3151
- * @returns The updated lobby object
3152
- *
3153
- * @remarks
3154
- * Uses bearer token for authorization and the user must be a lobby member with the CanLinkLobby lobby member flag.
3155
- */
3156
- linkChannelToLobby: (lobbyId: BigString, bearerToken: string, options: LinkChannelToLobby) => Promise<Camelize<DiscordLobby>>;
3157
- /**
3158
- * Unlinks any currently linked channels from the specified lobby.
3159
- *
3160
- * @param lobbyId - The ID of the lobby to unlink the channel from
3161
- * @param bearerToken - The access token of the user
3162
- * @returns The updated lobby object
3163
- *
3164
- * @remarks
3165
- * Uses bearer token for authorization and the user must be a lobby member with the CanLinkLobby lobby member flag.
3166
- */
3167
- unlinkChannelToLobby: (lobbyId: BigString, bearerToken: string) => Promise<Camelize<DiscordLobby>>;
3168
- /**
3169
- * Sets the moderation metadata for a lobby message. The metadata is app-scoped and delivered to active game clients via the Social SDK as a realtime message update.
3170
- *
3171
- * @param lobbyId - The ID of the lobby to set the moderation metadata
3172
- * @param messageId - The ID of the message to set the moderation metadata
3173
- * @param options - The moderation metadata to set
3174
- *
3175
- * @remarks
3176
- * Uses `Bot` token for authorization.
3177
- *
3178
- * For the options: Free-form key–value pairs describing the moderation decision. Up to 5 keys; key length <= 1024 characters; value length <= 2000 characters
3179
- *
3180
- * @see {@link https://discord.com/developers/docs/game-sdk/social-sdk/chat-moderation#server-side-chat-moderation} for the full moderation flow.
3181
- */
3182
- updateLobbyMessageModerationMetadata: (lobbyId: BigString, messageId: BigString, options: Record<string, string>) => Promise<void>;
3183
- /**
3184
- * Sends a message to the specified lobby. The calling user must be a member of the lobby.
3185
- *
3186
- * @param bearerToken - The access token of the user
3187
- * @param lobbyId - The ID of the lobby to send the message to
3188
- * @param options - The options to send the message
3189
- * @returns Returns the created lobby message object.
3190
- *
3191
- * @remarks
3192
- * Uses `Bearer` token for authorization with the `sdk.social_layer` scope.
3193
- *
3194
- * If the lobby has a linked channel, the message is also forwarded to that channel.
3195
- * If forwarding fails (for example, due to AutoMod), the lobby message is still delivered to other lobby members.
3196
- */
3197
- sendLobbyMessage: (bearerToken: string, lobbyId: BigString, options: SendLobbyMessage) => Promise<Camelize<DiscordLobbyMessage>>;
3198
- /**
3199
- * Returns the most recent messages in the specified lobby. The calling user must be a member of the lobby.
3200
- *
3201
- * @param bearerToken - The access token of the user
3202
- * @param lobbyId - The ID of the lobby to get the messages from
3203
- * @param options - The options to get the messages
3204
- * @returns Returns an array of lobby message objects
3205
- *
3206
- * @remarks
3207
- * Uses `Bearer` token for authorization with the `sdk.social_layer` scope.
3208
- */
3209
- getLobbyMessages: (bearerToken: string, lobbyId: BigString, options?: GetLobbyMessages) => Promise<Camelize<DiscordLobbyMessage>[]>;
3210
- /**
3211
- * Creates a single-use guild invite to the lobby's linked channel, targeted at the calling user.
3212
- *
3213
- *
3214
- * @param bearerToken - The access token of the user
3215
- * @param lobbyId - The ID of the lobby to create the invite for
3216
- * @returns The created invite object
3217
- *
3218
- * @remarks
3219
- * Uses `Bearer` token for authorization with the `sdk.social_layer` scope.
3220
- *
3221
- * The lobby must have a linked channel and the caller must be a member of the lobby.
3222
- * The invite expires after one hour.
3223
- */
3224
- createLobbyChannelInviteForSelf: (bearerToken: string, lobbyId: BigString) => Promise<Camelize<DiscordLobbyInvite>>;
3225
- /**
3226
- * Creates a single-use guild invite to the lobby's linked channel on behalf of an application, targeted at the specified user.
3227
- *
3228
- * @param lobbyId - The ID of the lobby to create the invite for
3229
- * @param userId - The ID of the user to create the invite for
3230
- * @returns The created invite object
3231
- *
3232
- * @remarks
3233
- * Uses `Bot` token for authorization
3234
- *
3235
- * The lobby must have a linked channel.
3236
- * The invite expires after one hour.
3237
- */
3238
- createLobbyChannelInviteForUser: (lobbyId: BigString, userId: BigString) => Promise<Camelize<DiscordLobbyInvite>>;
3239
- }
3240
- export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
3241
- export type ApiVersions = 9 | 10;
3242
- export interface CreateRequestBodyOptions {
3243
- headers?: Record<string, string>;
3244
- body?: any;
3245
- unauthorized?: boolean;
3246
- reason?: string;
3247
- files?: FileContent[];
3248
- /**
3249
- * An `AbortSignal` to cancel the request.
3250
- *
3251
- * @remarks
3252
- * Aborting rejects a request that is still waiting in the queue right away and guarantees it is never sent.
3253
- * An attempt that is already in flight gets its connection cancelled as well, though that cannot recall it:
3254
- * Discord (or the proxy) may have received it and may still process it, only the response is discarded.
3255
- * This lets a rest proxy drop requests that nobody is waiting on anymore (client disconnect, deadline)
3256
- * instead of leaving them in the queue.
3257
- */
3258
- signal?: AbortSignal;
3259
- }
3260
- export type MakeRequestOptions = Omit<CreateRequestBodyOptions, 'method'> & Pick<SendRequestOptions, 'runThroughQueue'>;
3261
- export interface RequestBody {
3262
- headers: Record<string, string>;
3263
- body?: string | FormData;
3264
- method: RequestMethods;
3265
- }
3266
- export interface SendRequestOptions {
3267
- /** The route to send the request to. */
3268
- route: string;
3269
- /** The method to use for sending the request. */
3270
- method: RequestMethods;
3271
- /** The amount of times this request has been retried. */
3272
- retryCount: number;
3273
- /** Handler to retry a request should it be rate limited. */
3274
- retryRequest?: (options: SendRequestOptions) => Promise<void>;
3275
- /** Resolve handler when a request succeeds. */
3276
- resolve: (value: RestRequestResponse) => void;
3277
- /** Reject handler when a request fails. */
3278
- reject: (value: RestRequestRejection) => void;
3279
- /** If this request has a bucket id which it falls under for rate limit */
3280
- bucketId?: string;
276
+ simplifiedUrl?: string;
3281
277
  /** Additional request options, used for things like overriding authorization header. */
3282
278
  requestBodyOptions?: CreateRequestBodyOptions;
3283
279
  /**