@discordeno/rest 19.0.0-next.f6bd769 → 19.0.0-next.fbd26f4

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/manager.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Queue } from './queue.js';
2
- import type { ApplicationCommandPermissions, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, CreateGuildChannel, CreateGuildEmoji, CreateGuildRole, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAutoModerationRule, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordGuild, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason, AtLeastOne, CreateGuildStickerOptions, DiscordAuditLog, DiscordBan, DiscordSticker, DiscordVanityUrl, DiscordVoiceRegion, EditGuildStickerOptions, GetBans, GetGuildAuditLog, ModifyGuild } from '@discordeno/types';
2
+ import type { ApplicationCommandPermissions, AtLeastOne, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, CreateGuildChannel, CreateGuildEmoji, CreateGuildFromTemplate, CreateGuildRole, CreateGuildStickerOptions, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAuditLog, DiscordAutoModerationRule, DiscordBan, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordGuild, DiscordGuildPreview, DiscordGuildWidget, DiscordGuildWidgetSettings, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordModifyGuildWelcomeScreen, DiscordPrunedCount, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordWebhook, DiscordWelcomeScreen, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, EditOwnVoiceState, EditScheduledEvent, EditStageInstanceOptions, EditUserVoiceState, ExecuteWebhook, GetBans, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetReactions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, MfaLevels, ModifyChannel, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
3
3
  import type { InvalidRequestBucket } from './invalidBucket.js';
4
4
  export declare function createRestManager(options: CreateRestManagerOptions): RestManager;
5
5
  export interface CreateRestManagerOptions {
@@ -80,8 +80,14 @@ export interface RestManager {
80
80
  };
81
81
  /** Routes for channel related endpoints. */
82
82
  channels: {
83
+ /** Route for handling bulk messages in a channel. */
84
+ bulk: (channelId: BigString) => string;
83
85
  /** Route for non-specific dm channel. */
84
86
  dm: () => string;
87
+ /** Route for handling a specific pin. */
88
+ pin: (channelId: BigString, messageId: BigString) => string;
89
+ /** Route for handling a channels pins. */
90
+ pins: (channelId: BigString) => string;
85
91
  /** Route for non-specific webhook in a channel. */
86
92
  webhooks: (channelId: BigString) => string;
87
93
  /** Route for a specific channel. */
@@ -129,6 +135,19 @@ export interface RestManager {
129
135
  };
130
136
  /** Route for handling typing indicators in a c«hannel. */
131
137
  typing: (channelId: BigString) => string;
138
+ /** Routes for handling reactions on a message. */
139
+ reactions: {
140
+ /** Route for handling a bots reaction. */
141
+ bot: (channelId: BigString, messageId: BigString, emoji: string) => string;
142
+ /** Route for handling a user's reactions. */
143
+ user: (channelId: BigString, messageId: BigString, emoji: string, userId: BigString) => string;
144
+ /** Route for handling all the reactions on a message. */
145
+ all: (channelId: BigString, messageId: BigString) => string;
146
+ /** Route for handling all reactions for a single emoji on a message. */
147
+ emoji: (channelId: BigString, messageId: BigString, emoji: string, options?: GetReactions) => string;
148
+ /** Route for handling a specific reaction on a message. */
149
+ message: (channelId: BigString, messageId: BigString, emoji: string, options?: GetReactions) => string;
150
+ };
132
151
  };
133
152
  /** Routes for guild related endpoints. */
134
153
  guilds: {
@@ -168,8 +187,22 @@ export interface RestManager {
168
187
  invite: (inviteCode: string, options?: GetInvite) => string;
169
188
  /** Route for handling non-specific invites in a guild. */
170
189
  invites: (guildId: BigString) => string;
190
+ /** Route for handling a bot leaving a guild. */
191
+ leave: (guildId: BigString) => string;
192
+ /** Route for handling a guild's preview. */
193
+ preview: (guildId: BigString) => string;
194
+ /** Route for handling pruning of a guild. */
195
+ prune: (guildId: BigString, options?: GetGuildPruneCountQuery) => string;
171
196
  /** Route for handling non-specific webhooks in a guild */
172
197
  webhooks: (guildId: BigString) => string;
198
+ /** Route for handling a guild's welcome screen. */
199
+ welcome: (guildId: BigString) => string;
200
+ /** Route for handling a guild's widget. */
201
+ widget: (guildId: BigString) => string;
202
+ /** Route for handling a guild's widget in the form of json. */
203
+ widgetJson: (guildId: BigString) => string;
204
+ /** Route for handling a guilds mfa level. */
205
+ mfa: (guildId: BigString) => string;
173
206
  /** Routes for handling a guild's members. */
174
207
  members: {
175
208
  /** Route for handling a specific guild member's ban. */
@@ -215,6 +248,8 @@ export interface RestManager {
215
248
  stickers: (guildId: BigString) => string;
216
249
  /** Route for handling non-specific guild stickers. */
217
250
  sticker: (guildId: BigString, stickerId: BigString) => string;
251
+ /** Route for handling a voice state. */
252
+ voice: (guildId: BigString, userId?: BigString) => string;
218
253
  };
219
254
  /** Routes for interaction related endpoints. */
220
255
  interactions: {
@@ -248,6 +283,8 @@ export interface RestManager {
248
283
  };
249
284
  /** Route for handling a sticker. */
250
285
  sticker: (stickerId: BigString) => string;
286
+ /** Route for handling all voice regions. */
287
+ regions: () => string;
251
288
  };
252
289
  /** Check the rate limits for a url or a bucket. */
253
290
  checkRateLimits: (url: string) => number | false;
@@ -277,1934 +314,44 @@ export interface RestManager {
277
314
  delete: (url: string, body?: Record<string, any>) => Promise<void>;
278
315
  /** Make a patch request to the api. */
279
316
  patch: <T = void>(url: string, body?: Record<string, any>) => Promise<Camelize<T>>;
280
- /** Helper methods related to channels */
281
- channels: {
282
- /** Methods related to messages in a channel */
283
- messages: {
284
- /**
285
- * Sends a message to a channel.
286
- *
287
- * @param channelId - The ID of the channel to send the message in.
288
- * @param options - The parameters for the creation of the message.
289
- * @returns An instance of the created {@link DiscordMessage}.
290
- *
291
- * @remarks
292
- * Requires that the bot user be able to see the contents of the channel the message is to be sent in.
293
- *
294
- * If sending a message to a guild channel:
295
- * - Requires the `SEND_MESSAGES` permission.
296
- *
297
- * If sending a TTS message:
298
- * - Requires the `SEND_TTS_MESSAGES` permission.
299
- *
300
- * If sending a message as a reply to another message:
301
- * - Requires the `READ_MESSAGE_HISTORY` permission.
302
- * - The message being replied to cannot be a system message.
303
- *
304
- * ⚠️ The maximum size of a request (accounting for any attachments and message content) for bot users is _8 MiB_.
305
- *
306
- * Fires a _Message Create_ gateway event.
307
- *
308
- * @see {@link https://discord.com/developers/docs/resources/channel#create-message}
309
- */
310
- send: (channelId: BigString, options: CreateMessageOptions) => Promise<Camelize<DiscordMessage>>;
311
- /**
312
- * Edits a message.
313
- *
314
- * @param channelId - The ID of the channel to edit the message in.
315
- * @param messageId - The IDs of the message to edit.
316
- * @param options - The parameters for the edit of the message.
317
- * @returns An instance of the edited {@link Message}.
318
- *
319
- * @remarks
320
- * If editing another user's message:
321
- * - Requires the `MANAGE_MESSAGES` permission.
322
- * - Only the {@link EditMessage.flags | flags} property of the {@link options} object parameter can be edited.
323
- *
324
- * Fires a _Message Update_ gateway event.
325
- *
326
- * @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
327
- */
328
- edit: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<Camelize<DiscordMessage>>;
329
- /**
330
- * Cross-posts a message posted in an announcement channel to subscribed channels.
331
- *
332
- * @param channelId - The ID of the announcement channel.
333
- * @param messageId - The ID of the message to cross-post.
334
- * @returns An instance of the cross-posted {@link Message}.
335
- *
336
- * @remarks
337
- * Requires the `SEND_MESSAGES` permission.
338
- *
339
- * If not cross-posting own message:
340
- * - Requires the `MANAGE_MESSAGES` permission.
341
- *
342
- * Fires a _Message Create_ event in the guilds the subscribed channels are in.
343
- *
344
- * @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
345
- */
346
- publish: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
347
- /**
348
- * Deletes a message from a channel.
349
- *
350
- * @param channelId - The ID of the channel to delete the message from.
351
- * @param messageId - The ID of the message to delete from the channel.
352
- *
353
- * @remarks
354
- * If not deleting own message:
355
- * - Requires the `MANAGE_MESSAGES` permission.
356
- *
357
- * Fires a _Message Delete_ gateway event.
358
- *
359
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
360
- */
361
- delete: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
362
- };
363
- /**
364
- * Gets a channel by its ID.
365
- *
366
- * @param id - The ID of the channel to get.
367
- * @returns An instance of {@link DiscordChannel}.
368
- *
369
- * @remarks
370
- * If the channel is a thread, a {@link ThreadMember} object is included in the result.
371
- *
372
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
373
- */
374
- get: (id: BigString) => Promise<Camelize<DiscordChannel>>;
375
- /**
376
- * Creates a channel within a guild.
377
- *
378
- * @param guildId - The ID of the guild to create the channel within.
379
- * @param options - The parameters for the creation of the channel.
380
- * @returns An instance of the created {@link DiscordChannel}.
381
- *
382
- * @remarks
383
- * Requires the `MANAGE_CHANNELS` permission.
384
- *
385
- * If setting permission overwrites, only the permissions the bot user has in the guild can be allowed or denied.
386
- *
387
- * Setting the `MANAGE_ROLES` permission is only possible for guild administrators.
388
- *
389
- * Fires a _Channel Create_ gateway event.
390
- *
391
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
392
- */
393
- create: (guildId: BigString, options: CreateGuildChannel) => Promise<Camelize<DiscordChannel>>;
394
- /**
395
- * Deletes a channel from within a guild.
396
- *
397
- * @param channelId - The ID of the channel to delete.
398
- * @returns An instance of the deleted {@link Channel}.
399
- *
400
- * @remarks
401
- * For community guilds, the _Rules_, _Guidelines_ and _Community Update_ channels cannot be deleted.
402
- *
403
- * If the channel is a thread:
404
- * - Requires the `MANAGE_THREADS` permission.
405
- *
406
- * - Fires a _Thread Delete_ gateway event.
407
- *
408
- * Otherwise:
409
- * - Requires the `MANAGE_CHANNELS` permission.
410
- *
411
- * - ⚠️ Deleting a category channel does not delete its child channels.
412
- * Instead, they will have their `parent_id` property removed, and a `Channel Update` gateway event will fire for each of them.
413
- *
414
- * - Fires a _Channel Delete_ gateway event.
415
- *
416
- * @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
417
- */
418
- delete: (channelId: BigString, reason?: string) => Promise<void>;
419
- /**
420
- * Edits a channel's settings.
421
- *
422
- * @param channelId - The ID of the channel to edit.
423
- * @param options - The parameters for the edit of the channel.
424
- * @returns An instance of the edited {@link DiscordChannel}.
425
- *
426
- * @remarks
427
- * If editing a channel of type {@link ChannelTypes.GroupDm}:
428
- * - Fires a _Channel Update_ gateway event.
429
- *
430
- * If editing a thread channel:
431
- * - 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.
432
- *
433
- * - Fires a _Thread Update_ gateway event.
434
- *
435
- * If editing a guild channel:
436
- * - Requires the `MANAGE_CHANNELS` permission.
437
- *
438
- * - If modifying permission overrides:
439
- * - Requires the `MANAGE_ROLES` permission.
440
- *
441
- * - 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.
442
- *
443
- * - If modifying a channel of type {@link ChannelTypes.GuildCategory}:
444
- * - Fires a _Channel Update_ gateway event for each child channel impacted in this change.
445
- * - Otherwise:
446
- * - Fires a _Channel Update_ gateway event.
447
- */
448
- edit: (channelId: BigString, options: ModifyChannel) => Promise<Camelize<DiscordChannel>>;
449
- /**
450
- * Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.
451
- *
452
- * @param sourceChannelId - The ID of the announcement channel to follow.
453
- * @param targetChannelId - The ID of the target channel - the channel to cross-post to.
454
- * @returns An instance of {@link DiscordFollowedChannel}.
455
- *
456
- * @remarks
457
- * Requires the `MANAGE_WEBHOOKS` permission in the __target channel__.
458
- *
459
- * Fires a _Webhooks Update_ gateway event.
460
- *
461
- * @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
462
- */
463
- follow: (sourceChannelId: BigString, targetChannelId: BigString) => Promise<Camelize<DiscordFollowedChannel>>;
464
- /** Forum related helpers in a channel */
465
- forums: {
466
- /**
467
- * Creates a new thread in a forum channel, and sends a message within the created thread.
468
- *
469
- * @param channelId - The ID of the forum channel to create the thread within.
470
- * @param options - The parameters for the creation of the thread.
471
- * @returns An instance of {@link DiscordChannel} with a nested {@link Message} object.
472
- *
473
- * @remarks
474
- * Requires the `CREATE_MESSAGES` permission.
475
- *
476
- * Fires a _Thread Create_ gateway event.
477
- * Fires a _Message Create_ gateway event.
478
- *
479
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel}
480
- *
481
- * @experimental
482
- */
483
- post: (channelId: BigString, options: CreateForumPostWithMessage) => Promise<Camelize<DiscordChannel>>;
484
- };
485
- /** Permission related helpers in a channel */
486
- permissions: {
487
- /**
488
- * Edits the permission overrides for a user or role in a channel.
489
- *
490
- * @param channelId - The ID of the channel to edit the permission overrides of.
491
- * @param options - The permission override.
492
- *
493
- * @remarks
494
- * Requires the `MANAGE_ROLES` permission.
495
- *
496
- * 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.
497
- *
498
- * Fires a _Channel Update_ gateway event.
499
- *
500
- * @see {@link https://discord.com/developers/docs/resources/channel#edit-channel-permissions}
501
- */
502
- edit: (channelId: BigString, options: EditChannelPermissionOverridesOptions) => Promise<void>;
503
- /**
504
- * Deletes a permission override for a user or role in a channel.
505
- *
506
- * @param channelId - The ID of the channel to delete the permission override of.
507
- * @param overwriteId - The ID of the permission override to delete.
508
- *
509
- * @remarks
510
- * Requires the `MANAGE_ROLES` permission.
511
- *
512
- * Fires a _Channel Update_ gateway event.
513
- *
514
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-permission}
515
- */
516
- delete: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise<void>;
517
- };
518
- threads: {
519
- get: {
520
- /**
521
- * Gets the list of all active threads for a guild.
522
- *
523
- * @param guildId - The ID of the guild to get the threads of.
524
- * @returns An instance of {@link DiscordActiveThreads}.
525
- *
526
- * @remarks
527
- * Returns both public and private threads.
528
- *
529
- * Threads are ordered by the `id` property in descending order.
530
- *
531
- * @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
532
- */
533
- active: (guildId: BigString) => Promise<Camelize<DiscordActiveThreads>>;
534
- /** Methods related to getting archived threads. */
535
- archived: {
536
- /**
537
- * Gets the list of private archived threads for a channel.
538
- *
539
- * @param channelId - The ID of the channel to get the archived threads for.
540
- * @param options - The parameters for the fetching of threads.
541
- * @returns An instance of {@link DiscordArchivedThreads}.
542
- *
543
- * @remarks
544
- * Requires the `READ_MESSAGE_HISTORY` permission.
545
- * Requires the `MANAGE_THREADS` permission.
546
- *
547
- * Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
548
- *
549
- * Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
550
- *
551
- * @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
552
- */
553
- private: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
554
- /**
555
- * Gets the list of private archived threads the bot is a member of for a channel.
556
- *
557
- * @param channelId - The ID of the channel to get the archived threads for.
558
- * @param options - The parameters for the fetching of threads.
559
- * @returns An instance of {@link DiscordArchivedThreads}.
560
- *
561
- * @remarks
562
- * Requires the `READ_MESSAGE_HISTORY` permission.
563
- *
564
- * Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
565
- *
566
- * Threads are ordered by the `id` property in descending order.
567
- *
568
- * @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
569
- */
570
- joined: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
571
- /**
572
- * Gets the list of public archived threads for a channel.
573
- *
574
- * @param channelId - The ID of the channel to get the archived threads for.
575
- * @param options - The parameters for the fetching of threads.
576
- * @returns An instance of {@link ArchivedThreads}.
577
- *
578
- * @remarks
579
- * Requires the `READ_MESSAGE_HISTORY` permission.
580
- *
581
- * If called on a channel of type {@link ChannelTypes.GuildText}, returns threads of type {@link ChannelTypes.GuildPublicThread}.
582
- * If called on a channel of type {@link ChannelTypes.GuildNews}, returns threads of type {@link ChannelTypes.GuildNewsThread}.
583
- *
584
- * Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
585
- *
586
- * @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
587
- */
588
- public: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
589
- };
590
- /**
591
- * Gets a thread member by their user ID.
592
- *
593
- * @param channelId - The ID of the thread to get the thread member of.
594
- * @param userId - The user ID of the thread member to get.
595
- * @returns An instance of {@link DiscordThreadMember}.
596
- *
597
- * @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
598
- */
599
- member: (channelId: BigString, userId: BigString) => Promise<Camelize<DiscordThreadMember>>;
600
- /**
601
- * Gets the list of thread members for a thread.
602
- *
603
- * @param channelId - The ID of the thread to get the thread members of.
604
- * @returns A collection of {@link DiscordThreadMember} assorted by user ID.
605
- *
606
- * @remarks
607
- * Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
608
- *
609
- * @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
610
- */
611
- members: (channelId: BigString) => Promise<Camelize<DiscordThreadMember[]>>;
612
- };
613
- /**
614
- * Adds the bot user to a thread.
615
- *
616
- * @param channelId - The ID of the thread to add the bot user to.
617
- *
618
- * @remarks
619
- * Requires the thread not be archived.
620
- *
621
- * Fires a _Thread Members Update_ gateway event.
622
- *
623
- * @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
624
- */
625
- join: (channelId: BigString) => Promise<void>;
626
- /**
627
- * Removes the bot user from a thread.
628
- *
629
- * @param channelId - The ID of the thread to remove the bot user from.
630
- *
631
- * @remarks
632
- * Requires the thread not be archived.
633
- *
634
- * Fires a _Thread Members Update_ gateway event.
635
- *
636
- * @see {@link https://discord.com/developers/docs/resources/channel#leave-thread}
637
- */
638
- leave: (channelId: BigString) => Promise<void>;
639
- /**
640
- * Removes a member from a thread.
641
- *
642
- * @param channelId - The ID of the thread to remove the thread member of.
643
- * @param userId - The user ID of the thread member to remove.
644
- *
645
- * @remarks
646
- * If the thread is of type {@link ChannelTypes.GuildPrivateThread}, requires to be the creator of the thread.
647
- * Otherwise, requires the `MANAGE_THREADS` permission.
648
- *
649
- * Requires the thread not be archived.
650
- *
651
- * Fires a _Thread Members Update_ gateway event.
652
- *
653
- * @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
654
- */
655
- kick: (channelId: BigString, userId: BigString) => Promise<void>;
656
- /** Methods related to creating a thread. */
657
- create: {
658
- with: {
659
- /**
660
- * Creates a thread, using an existing message as its point of origin.
661
- *
662
- * @param channelId - The ID of the channel in which to create the thread.
663
- * @param messageId - The ID of the message to use as the thread's point of origin.
664
- * @param options - The parameters to use for the creation of the thread.
665
- * @returns An instance of the created {@link Channel | Thread}.
666
- *
667
- * @remarks
668
- * If called on a channel of type {@link ChannelTypes.GuildText}, creates a {@link ChannelTypes.GuildPublicThread}.
669
- * If called on a channel of type {@link ChannelTypes.GuildNews}, creates a {@link ChannelTypes.GuildNewsThread}.
670
- * Does not work on channels of type {@link ChannelTypes.GuildForum}.
671
- *
672
- * The ID of the created thread will be the same as the ID of the source message.
673
- *
674
- * Fires a _Thread Create_ gateway event.
675
- *
676
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
677
- */
678
- message: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage) => Promise<Camelize<DiscordChannel>>;
679
- };
680
- without: {
681
- /**
682
- * Creates a thread without using a message as the thread's point of origin.
683
- *
684
- * @param channelId - The ID of the channel in which to create the thread.
685
- * @param options - The parameters to use for the creation of the thread.
686
- * @returns An instance of the created {@link DiscordChannel | Thread}.
687
- *
688
- * @remarks
689
- * Creating a private thread requires the server to be boosted.
690
- *
691
- * Fires a _Thread Create_ gateway event.
692
- *
693
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
694
- */
695
- message: (channelId: BigString, options: StartThreadWithoutMessage) => Promise<Camelize<DiscordChannel>>;
696
- };
697
- };
698
- };
699
- /**
700
- * Edits the positions of a set of channels in a guild.
701
- *
702
- * @param guildId - The ID of the guild in which to edit the positions of the channels.
703
- * @param channelPositions - A set of objects defining the updated positions of the channels.
704
- *
705
- * @remarks
706
- * Requires the `MANAGE_CHANNELS` permission.
707
- *
708
- * Fires a _Channel Update_ gateway event for every channel impacted in this change.
709
- *
710
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions}
711
- */
712
- positions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise<void>;
713
- /**
714
- * Gets the list of invites for a channel.
715
- *
716
- * @param channelId - The ID of the channel to get the invites of.
717
- * @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
718
- *
719
- * @remarks
720
- * Requires the `MANAGE_CHANNELS` permission.
721
- *
722
- * Only usable for guild channels.
723
- *
724
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
725
- */
726
- invites: (channelId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
727
- /** Stage related helpers for a channel. */
728
- stages: {
729
- /**
730
- * Creates a stage instance associated with a stage channel.
731
- *
732
- * @param options - The parameters for the creation of the stage instance.
733
- * @returns An instance of the created {@link DiscordStageInstance}.
734
- *
735
- * @remarks
736
- * Requires the user to be a moderator of the stage channel.
737
- *
738
- * Fires a _Stage Instance Create_ gateway event.
739
- *
740
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#create-stage-instance}
741
- */
742
- create: (options: CreateStageInstance) => Promise<Camelize<DiscordStageInstance>>;
743
- /**
744
- * Deletes the stage instance associated with a stage channel, if one exists.
745
- *
746
- * @param channelId - The ID of the stage channel the stage instance is associated with.
747
- *
748
- * @remarks
749
- * Requires the user to be a moderator of the stage channel.
750
- *
751
- * Fires a _Stage Instance Delete_ gateway event.
752
- *
753
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
754
- */
755
- delete: (channelId: BigString, reason?: string) => Promise<void>;
756
- /**
757
- * Edits a stage instance.
758
- *
759
- * @param channelId - The ID of the stage channel the stage instance is associated with.
760
- * @returns An instance of the updated {@link DiscordStageInstance}.
761
- *
762
- * @remarks
763
- * Requires the user to be a moderator of the stage channel.
764
- *
765
- * Fires a _Stage Instance Update_ event.
766
- *
767
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
768
- */
769
- edit: (channelId: BigString, data: EditStageInstanceOptions) => Promise<Camelize<DiscordStageInstance>>;
770
- /**
771
- * Gets the stage instance associated with a stage channel, if one exists.
772
- *
773
- * @param channelId - The ID of the stage channel the stage instance is associated with.
774
- * @returns An instance of {@link DiscordStageInstance}.
775
- *
776
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
777
- */
778
- get: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
779
- };
780
- /**
781
- * Triggers a typing indicator for the bot user.
782
- *
783
- * @param channelId - The ID of the channel in which to trigger the typing indicator.
784
- *
785
- * @remarks
786
- * Generally, bots should _not_ use this route.
787
- *
788
- * Fires a _Typing Start_ gateway event.
789
- *
790
- * @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
791
- */
792
- typing: (channelId: BigString) => Promise<void>;
793
- };
794
- /** Emoji related helper methods. */
795
- emojis: {
796
- /**
797
- * Creates an emoji in a guild.
798
- *
799
- * @param guildId - The ID of the guild in which to create the emoji.
800
- * @param options - The parameters for the creation of the emoji.
801
- * @returns An instance of the created {@link DiscordEmoji}.
802
- *
803
- * @remarks
804
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
805
- *
806
- * Emojis have a maximum file size of 256 kilobits. Attempting to upload a larger emoji will cause the route to return 400 Bad Request.
807
- *
808
- * Fires a _Guild Emojis Update_ gateway event.
809
- *
810
- * @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
811
- */
812
- create: (guildId: BigString, options: CreateGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
813
- /**
814
- * Deletes an emoji from a guild.
815
- *
816
- * @param guildId - The ID of the guild from which to delete the emoji.
817
- * @param id - The ID of the emoji to delete.
818
- *
819
- * @remarks
820
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
821
- *
822
- * Fires a _Guild Emojis Update_ gateway event.
823
- *
824
- * @see {@link https://discord.com/developers/docs/resources/emoji#delete-guild-emoji}
825
- */
826
- delete: (guildId: BigString, id: BigString, reason?: string) => Promise<void>;
827
- /**
828
- * Edits an emoji.
829
- *
830
- * @param guildId - The ID of the guild in which to edit the emoji.
831
- * @param id - The ID of the emoji to edit.
832
- * @param options - The parameters for the edit of the emoji.
833
- * @returns An instance of the updated {@link DiscordEmoji}.
834
- *
835
- * @remarks
836
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
837
- *
838
- * Fires a `Guild Emojis Update` gateway event.
839
- *
840
- * @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
841
- */
842
- edit: (guildId: BigString, id: BigString, options: ModifyGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
843
- /**
844
- * Gets an emoji by its ID.
845
- *
846
- * @param guildId - The ID of the guild from which to get the emoji.
847
- * @param emojiId - The ID of the emoji to get.
848
- * @returns An instance of {@link DiscordEmoji}.
849
- *
850
- * @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
851
- */
852
- get: (guildId: BigString, emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
853
- };
854
- /** Guild related helper methods */
855
- guilds: {
856
- /**
857
- * Gets a guild's audit log.
858
- *
859
- * @param guildId - The ID of the guild to get the audit log of.
860
- * @param options - The parameters for the fetching of the audit log.
861
- * @returns An instance of {@link AuditLog}.
862
- *
863
- * @remarks
864
- * Requires the `VIEW_AUDIT_LOG` permission.
865
- *
866
- * @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
867
- */
868
- auditlogs: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
869
- automod: {
870
- /**
871
- * Creates an automod rule in a guild.
872
- *
873
- * @param guildId - The ID of the guild to create the rule in.
874
- * @param options - The parameters for the creation of the rule.
875
- * @returns An instance of the created {@link DiscordAutoModerationRule}.
876
- *
877
- * @remarks
878
- * Requires the `MANAGE_GUILD` permission.
879
- *
880
- * Fires an _Auto Moderation Rule Create_ gateway event.
881
- *
882
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
883
- */
884
- create: (guildId: BigString, options: CreateAutoModerationRuleOptions) => Promise<Camelize<DiscordAutoModerationRule>>;
885
- /**
886
- * Deletes a scheduled event from a guild.
887
- *
888
- * @param guildId - The ID of the guild to delete the scheduled event from.
889
- * @param eventId - The ID of the scheduled event to delete.
890
- *
891
- * @remarks
892
- * Requires the `MANAGE_EVENTS` permission.
893
- *
894
- * Fires a _Guild Scheduled Event Delete_ gateway event.
895
- *
896
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
897
- */
898
- delete: (guildId: BigString, eventId: BigString) => Promise<void>;
899
- /**
900
- * Edits an automod rule.
901
- *
902
- * @param guildId - The ID of the guild to edit the rule in.
903
- * @param ruleId - The ID of the rule to edit.
904
- * @param options - The parameters for the edit of the rule.
905
- * @returns An instance of the edited {@link DiscordAutoModerationRule}.
906
- *
907
- * @remarks
908
- * Requires the `MANAGE_GUILD` permission.
909
- *
910
- * Fires an _Auto Moderation Rule Update_ gateway event.
911
- *
912
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
913
- */
914
- edit: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>) => Promise<Camelize<DiscordAutoModerationRule>>;
915
- /** Methods related to getting automoderation data in a guild. */
916
- get: {
917
- /**
918
- * Gets an automod rule by its ID.
919
- *
920
- * @param guildId - The ID of the guild to get the rule of.
921
- * @param ruleId - The ID of the rule to get.
922
- * @returns An instance of {@link DiscordAutoModerationRule}.
923
- *
924
- * @remarks
925
- * Requires the `MANAGE_GUILD` permission.
926
- *
927
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
928
- */
929
- rule: (guildId: BigString, ruleId: BigString) => Promise<Camelize<DiscordAutoModerationRule>>;
930
- /**
931
- * Gets the list of automod rules for a guild.
932
- *
933
- * @param guildId - The ID of the guild to get the rules from.
934
- * @returns A collection of {@link DiscordAutoModerationRule} objects assorted by rule ID.
935
- *
936
- * @remarks
937
- * Requires the `MANAGE_GUILD` permission.
938
- *
939
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
940
- */
941
- rules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
942
- };
943
- };
944
- /**
945
- * Gets a ban by user ID.
946
- *
947
- * @param guildId - The ID of the guild to get the ban from.
948
- * @param userId - The ID of the user to get the ban for.
949
- * @returns An instance of {@link DiscordBan}.
950
- *
951
- * @remarks
952
- * Requires the `BAN_MEMBERS` permission.
953
- *
954
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
955
- */
956
- ban: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
957
- /**
958
- * Gets the list of bans for a guild.
959
- *
960
- * @param guildId - The ID of the guild to get the list of bans for.
961
- * @param options - The parameters for the fetching of the list of bans.
962
- * @returns A collection of {@link DiscordBan} objects assorted by user ID.
963
- *
964
- * @remarks
965
- * Requires the `BAN_MEMBERS` permission.
966
- *
967
- * Users are ordered by their IDs in _ascending_ order.
968
- *
969
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
970
- */
971
- bans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan[]>>;
972
- /**
973
- * Creates a guild.
974
- *
975
- * @param options - The parameters for the creation of the guild.
976
- * @returns An instance of the created {@link DiscordGuild}.
977
- *
978
- * @remarks
979
- * ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
980
- *
981
- * Fires a _Guild Create_ gateway event.
982
- *
983
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
984
- */
985
- create: (options: CreateGuild) => Promise<Camelize<DiscordGuild>>;
986
- /**
987
- * Gets the list of channels for a guild.
988
- *
989
- * @param guildId - The ID of the guild to get the channels of.
990
- * @returns A collection of {@link DiscordChannel} objects assorted by channel ID.
991
- *
992
- * @remarks
993
- * Excludes threads.
994
- *
995
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
996
- */
997
- channels: (guildId: BigString) => Promise<Camelize<DiscordChannel[]>>;
998
- /**
999
- * Deletes a guild.
1000
- *
1001
- * @param guildId - The ID of the guild to delete.
1002
- *
1003
- * @remarks
1004
- * The bot user must be the owner of the guild.
1005
- *
1006
- * Fires a _Guild Delete_ gateway event.
1007
- *
1008
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
1009
- */
1010
- delete: (guildId: BigString) => Promise<void>;
1011
- /**
1012
- * Edits a guild's settings.
1013
- *
1014
- * @param guildId - The ID of the guild to edit.
1015
- * @param shardId - The ID of the shard the guild is in.
1016
- * @param options - The parameters for the edit of the guild.
1017
- * @returns An instance of the edited {@link Guild}.
1018
- *
1019
- * @remarks
1020
- * Requires the `MANAGE_GUILD` permission.
1021
- *
1022
- * If attempting to add or remove the {@link GuildFeatures.Community} feature:
1023
- * - Requires the `ADMINISTRATOR` permission.
1024
- *
1025
- * Fires a _Guild Update_ gateway event.
1026
- *
1027
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
1028
- */
1029
- edit: (guildId: BigString, options: ModifyGuild) => Promise<Camelize<DiscordGuild>>;
1030
- /**
1031
- * Gets the list of emojis for a guild.
1032
- *
1033
- * @param guildId - The ID of the guild which to get the emojis of.
1034
- * @returns A collection of {@link DiscordEmoji} objects assorted by emoji ID.
1035
- *
1036
- * @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
1037
- */
1038
- emojis: (guildId: BigString) => Promise<Camelize<DiscordEmoji[]>>;
1039
- /** Methods related to a guild's scheduled events. */
1040
- events: {
1041
- /**
1042
- * Creates a scheduled event in a guild.
1043
- *
1044
- * @param guildId - The ID of the guild to create the scheduled event in.
1045
- * @param options - The parameters for the creation of the scheduled event.
1046
- * @returns An instance of the created {@link ScheduledEvent}.
1047
- *
1048
- * @remarks
1049
- * Requires the `MANAGE_EVENTS` permission.
1050
- *
1051
- * A guild can only have a maximum of 100 events with a status of {@link ScheduledEventStatus.Active} or {@link ScheduledEventStatus.Scheduled} (inclusive).
1052
- *
1053
- * Fires a _Guild Scheduled Event Create_ gateway event.
1054
- *
1055
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
1056
- */
1057
- create: (guildId: BigString, options: CreateScheduledEvent) => Promise<Camelize<DiscordScheduledEvent>>;
1058
- /**
1059
- * Deletes a scheduled event from a guild.
1060
- *
1061
- * @param guildId - The ID of the guild to delete the scheduled event from.
1062
- * @param eventId - The ID of the scheduled event to delete.
1063
- *
1064
- * @remarks
1065
- * Requires the `MANAGE_EVENTS` permission.
1066
- *
1067
- * Fires a _Guild Scheduled Event Delete_ gateway event.
1068
- *
1069
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
1070
- */
1071
- delete: (guildId: BigString, eventId: BigString) => Promise<void>;
1072
- /**
1073
- * Edits a scheduled event.
1074
- *
1075
- * @param guildId - The ID of the guild to edit the scheduled event in.
1076
- * @param eventId - The ID of the scheduled event to edit.
1077
- * @returns An instance of the edited {@link ScheduledEvent}.
1078
- *
1079
- * @remarks
1080
- * Requires the `MANAGE_EVENTS` permission.
1081
- *
1082
- * To start or end an event, modify the event's `status` property.
1083
- *
1084
- * The `entity_metadata` property is discarded for events whose `entity_type` is not {@link ScheduledEventEntityType.External}.
1085
- *
1086
- * Fires a _Guild Scheduled Event Update_ gateway event.
1087
- *
1088
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
1089
- */
1090
- edit: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>) => Promise<Camelize<DiscordScheduledEvent>>;
1091
- get: {
1092
- /**
1093
- * Gets a scheduled event by its ID.
1094
- *
1095
- * @param guildId - The ID of the guild to get the scheduled event from.
1096
- * @param eventId - The ID of the scheduled event to get.
1097
- * @param options - The parameters for the fetching of the scheduled event.
1098
- * @returns An instance of {@link ScheduledEvent}.
1099
- *
1100
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event}
1101
- */
1102
- event: (guildId: BigString, eventId: BigString, options?: {
1103
- withUserCount?: boolean;
1104
- }) => Promise<Camelize<DiscordScheduledEvent>>;
1105
- /**
1106
- * Gets the list of scheduled events for a guild.
1107
- *
1108
- * @param guildId - The ID of the guild to get the scheduled events from.
1109
- * @param options - The parameters for the fetching of the scheduled events.
1110
- * @returns A collection of {@link ScheduledEvent} objects assorted by event ID.
1111
- *
1112
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
1113
- */
1114
- events: (guildId: BigString, options?: GetScheduledEvents) => Promise<Camelize<DiscordScheduledEvent[]>>;
1115
- /**
1116
- * Gets the list of subscribers to a scheduled event from a guild.
1117
- *
1118
- * @param guildId - The ID of the guild to get the subscribers to the scheduled event from.
1119
- * @param eventId - The ID of the scheduled event to get the subscribers of.
1120
- * @param options - The parameters for the fetching of the subscribers.
1121
- * @returns A collection of {@link User} objects assorted by user ID.
1122
- *
1123
- * @remarks
1124
- * Requires the `MANAGE_EVENTS` permission.
1125
- *
1126
- * Users are ordered by their IDs in _ascending_ order.
1127
- *
1128
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
1129
- */
1130
- users: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
1131
- user: Camelize<DiscordUser>;
1132
- member?: Camelize<DiscordMember>;
1133
- }>>;
1134
- };
1135
- };
1136
- /**
1137
- * Gets a guild by its ID.
1138
- *
1139
- * @param guildId - The ID of the guild to get.
1140
- * @param options - The parameters for the fetching of the guild.
1141
- * @returns An instance of {@link Guild}.
1142
- *
1143
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
1144
- */
1145
- get: (guildId: BigString, options?: {
1146
- counts?: boolean;
1147
- }) => Promise<Camelize<DiscordGuild>>;
1148
- /** Methods related to a guild's integrations. */
1149
- integrations: {
1150
- /**
1151
- * Gets the list of integrations attached to a guild.
1152
- *
1153
- * @param guildId - The ID of the guild to get the list of integrations from.
1154
- * @returns A collection of {@link Integration} objects assorted by integration ID.
1155
- *
1156
- * @remarks
1157
- * Requires the `MANAGE_GUILD` permission.
1158
- *
1159
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
1160
- */
1161
- get: (guildId: BigString) => Promise<Camelize<DiscordIntegration[]>>;
1162
- /**
1163
- * Deletes an integration attached to a guild.
1164
- *
1165
- * @param guildId - The ID of the guild from which to delete the integration.
1166
- * @param integrationId - The ID of the integration to delete from the guild.
1167
- *
1168
- * @remarks
1169
- * Requires the `MANAGE_GUILD` permission.
1170
- *
1171
- * Deletes all webhooks associated with the integration, and kicks the associated bot if there is one.
1172
- *
1173
- * Fires a _Guild Integrations Update_ gateway event.
1174
- * Fires a _Integration Delete_ gateway event.
1175
- *
1176
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
1177
- */
1178
- delete: (guildId: BigString, integrationId: BigString) => Promise<void>;
1179
- };
1180
- /** Methods related to a guild's invites. */
1181
- invites: {
1182
- /**
1183
- * Creates an invite to a channel in a guild.
1184
- *
1185
- * @param channelId - The ID of the channel to create the invite to.
1186
- * @param options - The parameters for the creation of the invite.
1187
- * @returns An instance of the created {@link DiscordInvite}.
1188
- *
1189
- * @remarks
1190
- * Requires the `CREATE_INSTANT_INVITE` permission.
1191
- *
1192
- * Fires an _Invite Create_ gateway event.
1193
- *
1194
- * @privateRemarks
1195
- * The request body is not optional, and an empty JSON object must be sent regardless of whether any fields are being transmitted.
1196
- *
1197
- * @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
1198
- */
1199
- create: (channelId: BigString, options?: CreateChannelInvite) => Promise<Camelize<DiscordInvite>>;
1200
- /**
1201
- * Deletes an invite to a channel.
1202
- *
1203
- * @param inviteCode - The invite code of the invite to delete.
1204
- *
1205
- * @remarks
1206
- * Requires the `MANAGE_CHANNELS` permission.
1207
- *
1208
- * Fires an _Invite Delete_ gateway event.
1209
- *
1210
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-invite}
1211
- */
1212
- delete: (inviteCode: string, reason?: string) => Promise<void>;
1213
- /**
1214
- * Gets an invite to a channel by its invite code.
1215
- *
1216
- * @param inviteCode - The invite code of the invite to get.
1217
- * @param options - The parameters for the fetching of the invite.
1218
- * @returns An instance of {@link DiscordInviteMetadata}.
1219
- *
1220
- * @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
1221
- */
1222
- get: (inviteCode: string, options?: GetInvite) => Promise<Camelize<DiscordInviteMetadata>>;
1223
- /**
1224
- * Gets the list of invites for a guild.
1225
- *
1226
- * @param guildId - The ID of the guild to get the invites from.
1227
- * @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
1228
- *
1229
- * @remarks
1230
- * Requires the `MANAGE_GUILD` permission.
1231
- *
1232
- * @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
1233
- */
1234
- list: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
1235
- };
1236
- /** Methods related to stickers in a guild. */
1237
- stickers: {
1238
- /**
1239
- * Create a new sticker for the guild.
1240
- *
1241
- * @param guildId The ID of the guild to get
1242
- * @return A {@link DiscordSticker}
1243
- *
1244
- * @remarks
1245
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
1246
- * Fires a Guild Stickers Update Gateway event.
1247
- * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
1248
- * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
1249
- *
1250
- * @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
1251
- */
1252
- create: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<Camelize<DiscordSticker>>;
1253
- /**
1254
- * Delete a new sticker for the guild.
1255
- *
1256
- * @param guildId The ID of the guild to get
1257
- * @return A {@link DiscordSticker}
1258
- *
1259
- * @remarks
1260
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
1261
- * Fires a Guild Stickers Update Gateway event.
1262
- * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
1263
- * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
1264
- *
1265
- * @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
1266
- */
1267
- delete: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
1268
- /**
1269
- * Edit the given sticker.
1270
- *
1271
- * @param guildId The ID of the guild to get
1272
- * @return A {@link DiscordSticker}
1273
- *
1274
- * @remarks
1275
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
1276
- * Fires a Guild Stickers Update Gateway event.
1277
- *
1278
- * @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
1279
- */
1280
- edit: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>) => Promise<Camelize<DiscordSticker>>;
1281
- /**
1282
- * Returns a sticker object for the given guild and sticker IDs.
1283
- *
1284
- * @param guildId The ID of the guild to get
1285
- * @param stickerId The ID of the sticker to get
1286
- * @return A {@link DiscordSticker}
1287
- *
1288
- * @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
1289
- *
1290
- * @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
1291
- */
1292
- sticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
1293
- /**
1294
- * Returns an array of sticker objects for the given guild.
1295
- *
1296
- * @param guildId The ID of the guild to get
1297
- * @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
1298
- *
1299
- * @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
1300
- *
1301
- * @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
1302
- */
1303
- stickers: (guildId: BigString) => Promise<Camelize<DiscordSticker[]>>;
1304
- };
1305
- /** Methods related to a guild's templates. */
1306
- templates: {
1307
- /**
1308
- * Creates a template from a guild.
1309
- *
1310
- * @param guildId - The ID of the guild to create the template from.
1311
- * @param options - The parameters for the creation of the template.
1312
- * @returns An instance of the created {@link Template}.
1313
- *
1314
- * @remarks
1315
- * Requires the `MANAGE_GUILD` permission.
1316
- *
1317
- * Fires a _Guild Update_ gateway event.
1318
- *
1319
- * @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
1320
- */
1321
- create: (guildId: BigString, options: CreateTemplate) => Promise<Camelize<DiscordTemplate>>;
1322
- /**
1323
- * Deletes a template from a guild.
1324
- *
1325
- * @param guildId - The ID of the guild to delete the template from.
1326
- * @param templateCode - The code of the template to delete.
1327
- *
1328
- * @remarks
1329
- * Requires the `MANAGE_GUILD` permission.
1330
- *
1331
- * Fires a _Guild Update_ gateway event.
1332
- *
1333
- * @see {@link https://discord.com/developers/docs/resources/guild-template#delete-guild-template}
1334
- */
1335
- delete: (guildId: BigString, templateCode: string) => Promise<void>;
1336
- /**
1337
- * Edits a template's settings.
1338
- *
1339
- * @param guildId - The ID of the guild to edit a template of.
1340
- * @param templateCode - The code of the template to edit.
1341
- * @param options - The parameters for the edit of the template.
1342
- * @returns An instance of the edited {@link Template}.
1343
- *
1344
- * @remarks
1345
- * Requires the `MANAGE_GUILD` permission.
1346
- *
1347
- * Fires a _Guild Update_ gateway event.
1348
- *
1349
- * @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
1350
- */
1351
- edit: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<Camelize<DiscordTemplate>>;
1352
- /**
1353
- * Gets a template by its code.
1354
- *
1355
- * @param templateCode - The code of the template to get.
1356
- * @returns An instance of {@link Template}.
1357
- *
1358
- * @remarks
1359
- * Requires the `MANAGE_GUILD` permission.
1360
- *
1361
- * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
1362
- */
1363
- get: (templateCode: string) => Promise<Camelize<DiscordTemplate>>;
1364
- /**
1365
- * Gets the list of templates for a guild.
1366
- *
1367
- * @param guildId - The ID of the guild to get the list of templates for.
1368
- * @returns A collection of {@link Template} objects assorted by template code.
1369
- *
1370
- * @remarks
1371
- * Requires the `MANAGE_GUILD` permission.
1372
- *
1373
- * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
1374
- */
1375
- list: (guildId: BigString) => Promise<Camelize<DiscordTemplate[]>>;
1376
- /**
1377
- * Synchronises a template with the current state of a guild.
1378
- *
1379
- * @param guildId - The ID of the guild to synchronise a template of.
1380
- * @returns An instance of the edited {@link Template}.
1381
- *
1382
- * @remarks
1383
- * Requires the `MANAGE_GUILD` permission.
1384
- *
1385
- * Fires a _Guild Update_ gateway event.
1386
- *
1387
- * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
1388
- */
1389
- sync: (guildId: BigString) => Promise<Camelize<DiscordTemplate>>;
1390
- };
1391
- members: {
1392
- /**
1393
- * Bans a user from a guild.
1394
- *
1395
- * @param guildId - The ID of the guild to ban the user from.
1396
- * @param userId - The ID of the user to ban from the guild.
1397
- * @param options - The parameters for the creation of the ban.
1398
- *
1399
- * @remarks
1400
- * Requires the `BAN_MEMBERS` permission.
1401
- *
1402
- * Fires a _Guild Ban Add_ gateway event.
1403
- *
1404
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
1405
- */
1406
- ban: (guildId: BigString, userId: BigString, options?: CreateGuildBan) => Promise<void>;
1407
- /**
1408
- * Edits the nickname of the bot user.
1409
- *
1410
- * @param guildId - The ID of the guild to edit the nickname of the bot user in.
1411
- * @param options - The parameters for the edit of the nickname.
1412
- * @returns An instance of the edited {@link DiscordMember}
1413
- *
1414
- * @remarks
1415
- * Fires a _Guild Member Update_ gateway event.
1416
- *
1417
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
1418
- */
1419
- editSelf: (guildId: BigString, options: EditBotMemberOptions) => Promise<Camelize<DiscordMember>>;
1420
- /**
1421
- * Edits a member's properties.
1422
- *
1423
- * @param guildId - The ID of the guild to edit the member of.
1424
- * @param userId - The user ID of the member to edit.
1425
- * @param options - The parameters for the edit of the user.
1426
- *
1427
- * @remarks
1428
- * This endpoint requires various permissions depending on what is edited about the member.
1429
- * To find out the required permission to enact a change, read the documentation of this endpoint's {@link ModifyGuildMember | parameters}.
1430
- *
1431
- * Fires a _Guild Member Update_ gateway event.
1432
- *
1433
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
1434
- */
1435
- edit: (guildId: BigString, userId: BigString, options: ModifyGuildMember) => Promise<Camelize<DiscordMember>>;
1436
- /**
1437
- * Gets or creates a DM channel with a user.
1438
- *
1439
- * @param userId - The ID of the user to create the DM channel with.
1440
- * @returns An instance of {@link Channel}.
1441
- *
1442
- * @see {@link https://discord.com/developers/docs/resources/user#create-dm}
1443
- */
1444
- dm: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
1445
- /**
1446
- * Gets the member object by user ID.
1447
- *
1448
- * @param guildId - The ID of the guild to get the member object for.
1449
- * @param userId - The ID of the user to get the member object for.
1450
- * @returns An instance of {@link DiscordMemberWithUser}.
1451
- *
1452
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
1453
- */
1454
- get: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
1455
- /**
1456
- * Gets the list of members for a guild.
1457
- *
1458
- * @param guildId - The ID of the guild to get the list of members for.
1459
- * @param options - The parameters for the fetching of the members.
1460
- * @returns A collection of {@link DiscordMemberWithUser} objects assorted by user ID.
1461
- *
1462
- * @remarks
1463
- * Requires the `GUILD_MEMBERS` intent.
1464
- *
1465
- * ⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use `fetchMembers()`:
1466
- * REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
1467
- * per minute per shard. For more information, read {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}.
1468
- *
1469
- * @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
1470
- * @see {@link https://discord.com/developers/docs/topics/gateway#request-guild-members}
1471
- * @see {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}
1472
- */
1473
- list: (guildId: BigString, options: ListGuildMembers) => Promise<Camelize<DiscordMemberWithUser[]>>;
1474
- /**
1475
- * Kicks a member from a guild.
1476
- *
1477
- * @param guildId - The ID of the guild to kick the member from.
1478
- * @param userId - The user ID of the member to kick from the guild.
1479
- *
1480
- * @remarks
1481
- * Requires the `KICK_MEMBERS` permission.
1482
- *
1483
- * Fires a _Guild Member Remove_ gateway event.
1484
- *
1485
- * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
1486
- */
1487
- kick: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
1488
- /**
1489
- * Initiates the process of pruning inactive members.
1490
- *
1491
- * @param guildId - The ID of the guild to prune the members of.
1492
- * @param options - The parameters for the pruning of members.
1493
- * @returns A number indicating how many members were pruned.
1494
- *
1495
- * @remarks
1496
- * Requires the `KICK_MEMBERS` permission.
1497
- *
1498
- * ❗ Requests to this endpoint will time out for large guilds. To prevent this from happening, set the {@link BeginGuildPrune.computePruneCount} property of the {@link 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.
1499
- *
1500
- * ⚠️ 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 {@link options} object parameter.
1501
- *
1502
- * Fires a _Guild Member Remove_ gateway event for every member kicked.
1503
- *
1504
- * @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
1505
- */
1506
- prune: (guildId: BigString, options: BeginGuildPrune) => Promise<{
1507
- pruned: number | null;
1508
- }>;
1509
- /**
1510
- * Gets the list of members whose usernames or nicknames start with a provided string.
1511
- *
1512
- * @param guildId - The ID of the guild to search in.
1513
- * @param query - The string to match usernames or nicknames against.
1514
- * @param options - The parameters for searching through the members.
1515
- * @returns A collection of {@link DiscordMember} objects assorted by user ID.
1516
- *
1517
- * @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
1518
- */
1519
- search: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<Camelize<DiscordMemberWithUser[]>>;
1520
- /**
1521
- * Unbans a user from a guild.
1522
- *
1523
- * @param guildId - The ID of the guild to unban the user in.
1524
- * @param userId - The ID of the user to unban.
1525
- *
1526
- * @remarks
1527
- * Requires the `BAN_MEMBERS` permission.
1528
- *
1529
- * Fires a _Guild Ban Remove_ gateway event.
1530
- *
1531
- * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
1532
- */
1533
- unban: (guildId: BigString, userId: BigString) => Promise<void>;
1534
- };
1535
- /** Interaction related helper methods. */
1536
- interactions: {
1537
- /** Command related helper methods. */
1538
- commands: {
1539
- /** Methods for creating a command. */
1540
- create: {
1541
- /**
1542
- * Creates an application command accessible globally; across different guilds and channels.
1543
- *
1544
- * @param command - The command to create.
1545
- * @returns An instance of the created {@link ApplicationCommand}.
1546
- *
1547
- * @remarks
1548
- * ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
1549
- * ⚠️ Global commands once created are cached for periods of __an hour__, so changes made to existing commands will take an hour to surface.
1550
- * ⚠️ You can only create up to 200 _new_ commands daily.
1551
- *
1552
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
1553
- */
1554
- global: (command: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1555
- /**
1556
- * Creates an application command only accessible in a specific guild.
1557
- *
1558
- * @param command - The command to create.
1559
- * @param guildId - The ID of the guild to create the command for.
1560
- * @returns An instance of the created {@link ApplicationCommand}.
1561
- *
1562
- * @remarks
1563
- * ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
1564
- * ⚠️ You can only create up to 200 _new_ commands daily.
1565
- *
1566
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
1567
- */
1568
- guild: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
1569
- };
1570
- /** Methods for deleting a command. */
1571
- delete: {
1572
- /**
1573
- * Deletes an application command registered globally.
1574
- *
1575
- * @param commandId - The ID of the command to delete.
1576
- *
1577
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
1578
- */
1579
- global: (commandId: BigString) => Promise<void>;
1580
- /**
1581
- * Deletes an application command registered in a guild.
1582
- *
1583
- * @param guildId - The ID of the guild to delete the command from.
1584
- * @param commandId - The ID of the command to delete from the guild.
1585
- *
1586
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
1587
- */
1588
- guild: (commandId: BigString, guildId: BigString) => Promise<void>;
1589
- };
1590
- /** Methods for editing a command. */
1591
- edit: {
1592
- /**
1593
- * Edits a global application command.
1594
- *
1595
- * @param commandId - The ID of the command to edit.
1596
- * @param options - The parameters for the edit of the command.
1597
- * @returns An instance of the edited {@link ApplicationCommand}.
1598
- *
1599
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
1600
- */
1601
- global: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1602
- /**
1603
- * Edits an application command registered in a guild.
1604
- *
1605
- * @param guildId - The ID of the guild the command is registered in.
1606
- * @param commandId - The ID of the command to edit.
1607
- * @param options - The parameters for the edit of the command.
1608
- * @returns An instance of the edited {@link ApplicationCommand}.
1609
- *
1610
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
1611
- */
1612
- guild: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1613
- /**
1614
- * Edits the permissions for a guild application command.
1615
- *
1616
- * @param guildId - The ID of the guild the command is registered in.
1617
- * @param commandId - The ID of the command to edit the permissions of.
1618
- * @param bearerToken - The bearer token to use to make the request.
1619
- * @param options - The parameters for the edit of the command permissions.
1620
- * @returns An instance of the edited {@link ApplicationCommandPermission}.
1621
- *
1622
- * @remarks
1623
- * 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.
1624
- *
1625
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
1626
- */
1627
- permissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
1628
- };
1629
- /** Methods for getting a command. */
1630
- get: {
1631
- global: {
1632
- /**
1633
- * Gets a global application command by its ID.
1634
- *
1635
- * @param commandId - The ID of the command to get.
1636
- * @returns An instance of {@link ApplicationCommand}.
1637
- *
1638
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
1639
- */
1640
- one: (commandId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
1641
- /**
1642
- * Gets the list of your bot's global application commands.
1643
- *
1644
- * @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
1645
- *
1646
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
1647
- */
1648
- all: () => Promise<Camelize<DiscordApplicationCommand[]>>;
1649
- };
1650
- guilds: {
1651
- /**
1652
- * Gets a guild application command by its ID.
1653
- *
1654
- * @param guildId - The ID of the guild the command is registered in.
1655
- * @param commandId - The ID of the command to get.
1656
- * @returns An instance of {@link ApplicationCommand}.
1657
- *
1658
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
1659
- */
1660
- one: (commandId: BigString, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
1661
- /**
1662
- * Gets the list of application commands registered by your bot in a guild.
1663
- *
1664
- * @param guildId - The ID of the guild the commands are registered in.
1665
- * @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
1666
- *
1667
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
1668
- */
1669
- all: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
1670
- };
1671
- /**
1672
- * Gets the permissions of a guild application command.
1673
- *
1674
- * @param guildId - The ID of the guild the command is registered in.
1675
- * @param commandId - The ID of the command to get the permissions of.
1676
- * @returns An instance of {@link ApplicationCommandPermission}.
1677
- *
1678
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
1679
- */
1680
- permission: (guildId: BigString, commandId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
1681
- /**
1682
- * Gets the permissions of all application commands registered in a guild by the ID of the guild.
1683
- *
1684
- * @param guildId - The ID of the guild to get the permissions objects of.
1685
- * @returns A collection of {@link ApplicationCommandPermission} objects assorted by command ID.
1686
- *
1687
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
1688
- */
1689
- permissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
1690
- };
1691
- /** Methods for replacing existing commands in bulk. */
1692
- replace: {
1693
- /**
1694
- * Re-registers the list of global application commands, overwriting the previous commands completely.
1695
- *
1696
- * @param commands - The list of commands to use to overwrite the previous list.
1697
- * @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
1698
- *
1699
- * @remarks
1700
- * ❗ Commands that are not present in the `commands` array will be __deleted__.
1701
- *
1702
- * ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
1703
- *
1704
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
1705
- */
1706
- global: (commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
1707
- /**
1708
- * Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.
1709
- *
1710
- * @param guildId - The ID of the guild whose list of commands to overwrite.
1711
- * @param commands - The list of commands to use to overwrite the previous list.
1712
- * @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
1713
- *
1714
- * @remarks
1715
- * ❗ Commands that are not present in the `commands` array will be __deleted__.
1716
- *
1717
- * ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
1718
- *
1719
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
1720
- */
1721
- guild: (guildId: BigString, commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
1722
- };
1723
- };
1724
- /** Response related helper methods. */
1725
- responses: {
1726
- /** Helper methods related to creating a response. */
1727
- create: {
1728
- /**
1729
- * Sends a follow-up message to an interaction.
1730
- *
1731
- * @param token - The interaction token to use, provided in the original interaction.
1732
- * @param options - The parameters for the creation of the message.
1733
- * @returns An instance of the created {@link Message}.
1734
- *
1735
- * @remarks
1736
- * ⚠️ Interaction tokens are only valid for _15 minutes_.
1737
- *
1738
- * By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
1739
- *
1740
- * Unlike `sendMessage()`, this endpoint allows the bot user to act without:
1741
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1742
- * - Requiring the `MESSAGE_CONTENT` intent.
1743
- *
1744
- * Fires a _Message Create_ event.
1745
- *
1746
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
1747
- */
1748
- followup: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
1749
- /**
1750
- * Sends a response to an interaction.
1751
- *
1752
- * @param interactionId - The ID of the interaction to respond to.
1753
- * @param token - The interaction token to use, provided in the original interaction.
1754
- * @param options - The parameters for the creation of the message.
1755
- * @returns An instance of the created {@link Message}.
1756
- *
1757
- * @remarks
1758
- * ⚠️ Interaction tokens are only valid for _15 minutes_.
1759
- *
1760
- * By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
1761
- *
1762
- * Unlike `sendMessage()`, this endpoint allows the bot user to act without:
1763
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1764
- * - Requiring the `MESSAGE_CONTENT` intent.
1765
- *
1766
- * Fires a _Message Create_ event.
1767
- *
1768
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1769
- */
1770
- original: (interactionId: BigString, token: string, options: InteractionResponse) => Promise<void>;
1771
- };
1772
- /** Helper methods related to deleting a response. */
1773
- delete: {
1774
- /**
1775
- * Deletes a follow-up message to an interaction.
1776
- *
1777
- * @param token - The interaction token to use, provided in the original interaction.
1778
- * @param messageId - The ID of the message to delete.
1779
- *
1780
- * @remarks
1781
- * Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
1782
- *
1783
- * Fires a _Message Delete_ event.
1784
- *
1785
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message}
1786
- */
1787
- followup: (token: string, messageId: BigString) => Promise<void>;
1788
- /**
1789
- * Deletes the initial message response to an interaction.
1790
- *
1791
- * @param token - The interaction token to use, provided in the original interaction.
1792
- *
1793
- * @remarks
1794
- * Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
1795
- *
1796
- * Fires a _Message Delete_ event.
1797
- *
1798
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
1799
- */
1800
- original: (token: string) => Promise<void>;
1801
- };
1802
- /** Helper methods related to editing a response. */
1803
- edit: {
1804
- /**
1805
- * Edits a follow-up message to an interaction.
1806
- *
1807
- * @param token - The interaction token to use, provided in the original interaction.
1808
- * @param messageId - The ID of the message to edit.
1809
- * @param options - The parameters for the edit of the message.
1810
- * @returns An instance of the edited {@link Message}.
1811
- *
1812
- * @remarks
1813
- * Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
1814
- *
1815
- * Does not support ephemeral follow-up messages due to these being stateless.
1816
- *
1817
- * Fires a _Message Update_ event.
1818
- *
1819
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
1820
- */
1821
- followup: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
1822
- /**
1823
- * Edits the initial message response to an interaction.
1824
- *
1825
- * @param token - The interaction token to use, provided in the original interaction.
1826
- * @param options - The parameters for the edit of the response.
1827
- * @returns An instance of the edited {@link Message}.
1828
- *
1829
- * @remarks
1830
- * Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
1831
- *
1832
- * Does not support ephemeral follow-up messages due to these being stateless.
1833
- *
1834
- * Fires a _Message Update_ event.
1835
- *
1836
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
1837
- */
1838
- original: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage> | undefined>;
1839
- };
1840
- /** Helper methods related to getting a response. */
1841
- get: {
1842
- /**
1843
- * Gets a follow-up message to an interaction by the ID of the message.
1844
- *
1845
- * @param token - The interaction token to use, provided in the original interaction.
1846
- * @param messageId - The ID of the message to get.
1847
- * @returns An instance of {@link Message}.
1848
- *
1849
- * @remarks
1850
- * Unlike `getMessage()`, this endpoint allows the bot user to act without:
1851
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1852
- * - Requiring the `MESSAGE_CONTENT` intent.
1853
- *
1854
- * Does not support ephemeral follow-up messages due to these being stateless.
1855
- *
1856
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message}
1857
- */
1858
- followup: (token: string, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
1859
- /**
1860
- * Gets the initial message response to an interaction.
1861
- *
1862
- * @param token - The interaction token to use, provided in the original interaction.
1863
- * @returns An instance of {@link Message}.
1864
- *
1865
- * @remarks
1866
- * Unlike `getMessage()`, this endpoint allows the bot user to act without:
1867
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1868
- * - Requiring the `MESSAGE_CONTENT` intent.
1869
- *
1870
- * Does not support ephemeral follow-up messages due to these being stateless.
1871
- *
1872
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
1873
- */
1874
- original: (token: string) => Promise<Camelize<DiscordMessage>>;
1875
- };
1876
- };
1877
- };
1878
- /** Role related helpers methods. */
1879
- roles: {
1880
- /**
1881
- * Adds a role to a member.
1882
- *
1883
- * @param guildId - The ID of the guild the member to add the role to is in.
1884
- * @param userId - The user ID of the member to add the role to.
1885
- * @param roleId - The ID of the role to add to the member.
1886
- *
1887
- * @remarks
1888
- * Requires the `MANAGE_ROLES` permission.
1889
- *
1890
- * Fires a _Guild Member Update_ gateway event.
1891
- *
1892
- * @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member-role}
1893
- */
1894
- add: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
1895
- /**
1896
- * Creates a role in a guild.
1897
- *
1898
- * @param guildId - The ID of the guild to create the role in.
1899
- * @param options - The parameters for the creation of the role.
1900
- * @returns An instance of the created {@link DiscordRole}.
1901
- *
1902
- * @remarks
1903
- * Requires the `MANAGE_ROLES` permission.
1904
- *
1905
- * Fires a _Guild Role Create_ gateway event.
1906
- *
1907
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
1908
- */
1909
- create: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
1910
- /**
1911
- * Deletes a role from a guild.
1912
- *
1913
- * @param guildId - The ID of the guild to delete the role from.
1914
- * @param roleId - The ID of the role to delete.
1915
- *
1916
- * @remarks
1917
- * Requires the `MANAGE_ROLES` permission.
1918
- *
1919
- * Fires a _Guild Role Delete_ gateway event.
1920
- *
1921
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
1922
- */
1923
- delete: (guildId: BigString, roleId: BigString) => Promise<void>;
1924
- /**
1925
- * Edits a role in a guild.
1926
- *
1927
- * @param guildId - The ID of the guild to edit the role in.
1928
- * @param roleId - The ID of the role to edit.
1929
- * @param options - The parameters for the edit of the role.
1930
- * @returns An instance of the edited {@link DiscordRole}.
1931
- *
1932
- * @remarks
1933
- * Requires the `MANAGE_ROLES` permission.
1934
- *
1935
- * Fires a _Guild Role Update_ gateway event.
1936
- *
1937
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
1938
- */
1939
- edit: (guildId: BigString, roleId: BigString, options: EditGuildRole) => Promise<Camelize<DiscordRole>>;
1940
- /**
1941
- * Edits the positions of a set of roles.
1942
- *
1943
- * @param guildId - The ID of the guild to edit the role positions in.
1944
- * @param options - The parameters for the edit of the role positions.
1945
- * @returns A collection of {@link DiscordRole} objects assorted by role ID.
1946
- *
1947
- * @remarks
1948
- * Requires the `MANAGE_ROLES` permission.
1949
- *
1950
- * Fires a _Guild Role Update_ gateway event for every role impacted in this change.
1951
- *
1952
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
1953
- */
1954
- positions: (guildId: BigString, options: ModifyRolePositions[]) => Promise<Camelize<DiscordRole[]>>;
1955
- /**
1956
- * Gets the list of roles for a guild.
1957
- *
1958
- * @param guildId - The ID of the guild to get the list of roles for.
1959
- * @returns A collection of {@link DisorcRole} objects assorted by role ID.
1960
- *
1961
- * @remarks
1962
- * ⚠️ This endpoint should be used sparingly due to {@link User} objects already being included in guild payloads.
1963
- *
1964
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
1965
- */
1966
- list: (guildId: BigString) => Promise<Camelize<DiscordRole[]>>;
1967
- /**
1968
- * Removes a role from a member.
1969
- *
1970
- * @param guildId - The ID of the guild the member to remove the role from is in.
1971
- * @param userId - The user ID of the member to remove the role from.
1972
- * @param roleId - The ID of the role to remove from the member.
1973
- *
1974
- * @remarks
1975
- * Requires the `MANAGE_ROLES` permission.
1976
- *
1977
- * Fires a _Guild Member Update_ gateway event.
1978
- *
1979
- * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member-role}
1980
- */
1981
- remove: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
1982
- };
1983
- /**
1984
- * Gets information about the vanity url of a guild.
1985
- *
1986
- * @param guildId - The ID of the guild to get the vanity url information for.
1987
- * @returns An instance of {@link VanityUrl}.
1988
- *
1989
- * @remarks
1990
- * Requires the `MANAGE_GUILD` permission.
1991
- *
1992
- * The `code` property will be `null` if the guild does not have a set vanity url.
1993
- *
1994
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
1995
- */
1996
- vanity: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
1997
- /**
1998
- * Gets the list of voice regions for a guild.
1999
- *
2000
- * @param guildId - The ID of the guild to get the voice regions for.
2001
- * @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
2002
- *
2003
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
2004
- */
2005
- regions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion[]>>;
2006
- };
2007
317
  /**
2008
- * Returns a sticker object for the given sticker ID.
318
+ * Adds a reaction to a message.
2009
319
  *
2010
- * @param stickerId The ID of the sticker to get
2011
- * @returns A {@link DiscordSticker}
320
+ * @param channelId - The ID of the channel the message to add a reaction to is in.
321
+ * @param messageId - The ID of the message to add a reaction to.
322
+ * @param reaction - The reaction to add to the message.
323
+ * @returns
2012
324
  *
2013
- * @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
325
+ * @remarks
326
+ * Requires the `READ_MESSAGE_HISTORY` permission.
327
+ *
328
+ * If nobody else has reacted to the message:
329
+ * - Requires the `ADD_REACTIONS` permission.
330
+ *
331
+ * Fires a _Message Reaction Add_ gateway event.
332
+ *
333
+ * @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
2014
334
  */
2015
- sticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
2016
- /** Webhook related helper methods. */
2017
- webhooks: {
2018
- /**
2019
- * Creates a webhook.
2020
- *
2021
- * @param channelId - The ID of the channel to create the webhook in.
2022
- * @param options - The parameters for the creation of the webhook.
2023
- * @returns An instance of the created {@link DiscordWebhook}.
2024
- *
2025
- * @remarks
2026
- * Requires the `MANAGE_WEBHOOKS` permission.
2027
- *
2028
- * ⚠️ The webhook name must not contain the string 'clyde' (case-insensitive).
2029
- *
2030
- * Fires a _Webhooks Update_ gateway event.
2031
- *
2032
- * @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
2033
- */
2034
- create: (channelId: BigString, options: CreateWebhook) => Promise<Camelize<DiscordWebhook>>;
2035
- /** Methods to delete a webhook. */
2036
- delete: {
2037
- with: {
2038
- /**
2039
- * Deletes a webhook.
2040
- *
2041
- * @param id - The ID of the webhook to delete.
2042
- *
2043
- * @remarks
2044
- * Requires the `MANAGE_WEBHOOKS` permission.
2045
- *
2046
- * Fires a _Webhooks Update_ gateway event.
2047
- *
2048
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
2049
- */
2050
- id: (id: BigString, reason?: string) => Promise<void>;
2051
- /**
2052
- * Deletes a webhook message using the webhook token, thereby bypassing the need for authentication + permissions.
2053
- *
2054
- * @param id - The ID of the webhook to delete the message belonging to.
2055
- * @param token - The webhook token, used to delete the webhook.
2056
- *
2057
- * @remarks
2058
- * Fires a _Message Delete_ gateway event.
2059
- *
2060
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token}
2061
- */
2062
- token: (id: BigString, token: string) => Promise<void>;
2063
- };
2064
- };
2065
- /** Methods related to editing a webhook. */
2066
- edit: {
2067
- with: {
2068
- /**
2069
- * Edits a webhook.
2070
- *
2071
- * @param webhookId - The ID of the webhook to edit.
2072
- * @returns An instance of the edited {@link DiscordWebhook}.
2073
- *
2074
- * @remarks
2075
- * Requires the `MANAGE_WEBHOOKS` permission.
2076
- *
2077
- * Fires a _Webhooks Update_ gateway event.
2078
- *
2079
- * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook}
2080
- */
2081
- id: (webhookId: BigString, options: ModifyWebhook) => Promise<Camelize<DiscordWebhook>>;
2082
- /**
2083
- * Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
2084
- *
2085
- * @param webhookId - The ID of the webhook to edit.
2086
- * @param token - The webhook token, used to edit the webhook.
2087
- * @returns An instance of the edited {@link DiscordWebhook}.
2088
- *
2089
- * @remarks
2090
- * Requires the `MANAGE_WEBHOOKS` permission.
2091
- *
2092
- * Fires a _Webhooks Update_ gateway event.
2093
- *
2094
- * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
2095
- */
2096
- token: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
2097
- };
2098
- };
2099
- /**
2100
- * Executes a webhook, causing a message to be posted in the channel configured for the webhook.
2101
- *
2102
- * @param webhookId - The ID of the webhook to execute.
2103
- * @param token - The webhook token, used to execute the webhook.
2104
- * @param options - The parameters for the execution of the webhook.
2105
- * @returns An instance of the created {@link DiscordMessage}, or `undefined` if the {@link ExecuteWebhook.wait | wait} property of the {@link options} object parameter is set to `false`.
2106
- *
2107
- * @remarks
2108
- * If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
2109
- *
2110
- * @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
2111
- */
2112
- execute: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<Camelize<DiscordMessage> | undefined>;
2113
- /** Methods related to getting webhooks. */
2114
- get: {
2115
- /**
2116
- * Gets a list of webhooks for a channel.
2117
- *
2118
- * @param channelId - The ID of the channel which to get the webhooks of.
2119
- * @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
2120
- *
2121
- * @remarks
2122
- * Requires the `MANAGE_WEBHOOKS` permission.
2123
- *
2124
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-channel-webhooks}
2125
- */
2126
- channel: (channelId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
2127
- /**
2128
- * Gets the list of webhooks for a guild.
2129
- *
2130
- * @param guildId - The ID of the guild to get the list of webhooks for.
2131
- * @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
2132
- *
2133
- * @remarks
2134
- * Requires the `MANAGE_WEBHOOKS` permission.
2135
- *
2136
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
2137
- */
2138
- guild: (guildId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
2139
- /**
2140
- * Gets a webhook message by its ID.
2141
- *
2142
- * @param webhookId - The ID of the webhook to get a message of.
2143
- * @param token - The webhook token, used to get webhook messages.
2144
- * @param messageId - the ID of the webhook message to get.
2145
- * @param options - The parameters for the fetching of the message.
2146
- * @returns An instance of {@link DiscordMessage}.
2147
- *
2148
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
2149
- */
2150
- message: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
2151
- with: {
2152
- /**
2153
- * Gets a webhook by its ID.
2154
- *
2155
- * @param webhookId - The ID of the webhook to get.
2156
- * @returns An instance of {@link DiscordWebhook}.
2157
- *
2158
- * @remarks
2159
- * Requires the `MANAGE_WEBHOOKS` permission.
2160
- *
2161
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
2162
- */
2163
- id: (webhookId: BigString) => Promise<Camelize<DiscordWebhook>>;
2164
- /**
2165
- * Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
2166
- *
2167
- * @param webhookId - The ID of the webhook to get.
2168
- * @param token - The webhook token, used to get the webhook.
2169
- * @returns An instance of {@link DiscordWebhook}.
2170
- *
2171
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
2172
- */
2173
- token: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
2174
- };
2175
- };
2176
- /** Methods related to message sent by a webhook. */
2177
- messages: {
2178
- /**
2179
- * Deletes a webhook message.
2180
- *
2181
- * @param webhookId - The ID of the webhook to delete the message belonging to.
2182
- * @param token - The webhook token, used to manage the webhook.
2183
- * @param messageId - The ID of the message to delete.
2184
- * @param options - The parameters for the deletion of the message.
2185
- *
2186
- * @remarks
2187
- * Fires a _Message Delete_ gateway event.
2188
- *
2189
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
2190
- */
2191
- delete: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise<void>;
2192
- /** Methods related to editing messages sent by a webhook. */
2193
- edit: WebhookMessageEditor;
2194
- };
2195
- };
2196
- /** User related helper methods. */
2197
- users: {
2198
- /**
2199
- * Gets or creates a DM channel with a user.
2200
- *
2201
- * @param userId - The ID of the user to create the DM channel with.
2202
- * @returns An instance of {@link DiscordChannel}.
2203
- *
2204
- * @see {@link https://discord.com/developers/docs/resources/user#create-dm}
2205
- */
2206
- channel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
2207
- };
335
+ addReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
336
+ /**
337
+ * Adds multiple a reaction to a message.
338
+ *
339
+ * This function uses the `addReaction()` helper behind the scenes.
340
+ *
341
+ * @param channelId - The ID of the channel the message to add reactions to is in.
342
+ * @param messageId - The ID of the message to add the reactions to.
343
+ * @param reactions - The reactions to add to the message.
344
+ * @param ordered - Whether the reactions must be added in order or not.
345
+ *
346
+ * @remarks
347
+ * Requires the `READ_MESSAGE_HISTORY` permission.
348
+ *
349
+ * If nobody else has reacted to the message:
350
+ * - Requires the `ADD_REACTIONS` permission.
351
+ *
352
+ * Fires a _Message Reaction Add_ gateway event for every reaction added.
353
+ */
354
+ addReactions: (channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean) => Promise<void>;
2208
355
  /**
2209
356
  * Adds a role to a member.
2210
357
  *
@@ -2346,6 +493,21 @@ export interface RestManager {
2346
493
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
2347
494
  */
2348
495
  createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
496
+ /**
497
+ * Creates a guild from a template.
498
+ *
499
+ * @param templateCode - The code of the template.
500
+ * @param options - The parameters for the creation of the guild.
501
+ * @returns An instance of the created {@link Guild}.
502
+ *
503
+ * @remarks
504
+ * ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
505
+ *
506
+ * Fires a _Guild Create_ gateway event.
507
+ *
508
+ * @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
509
+ */
510
+ createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<Camelize<DiscordGuild>>;
2349
511
  /**
2350
512
  * Create a new sticker for the guild.
2351
513
  *
@@ -2642,6 +804,22 @@ export interface RestManager {
2642
804
  * @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
2643
805
  */
2644
806
  deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
807
+ /**
808
+ * Deletes multiple messages from a channel.
809
+ *
810
+ * @param channelId - The ID of the channel to delete the messages from.
811
+ * @param messageIds - The IDs of the messages to delete from the channel.
812
+ *
813
+ * @remarks
814
+ * Requires the `MANAGE_MESSAGES` permission.
815
+ *
816
+ * ⚠️ Messages older than 2 weeks old cannot be deleted.
817
+ *
818
+ * Fires a _Message Delete Bulk_ gateway event.
819
+ *
820
+ * @see {@link https://discord.com/developers/docs/resources/channel#bulk-delete-messages}
821
+ */
822
+ deleteMessages: (channelId: BigString, messageIds: BigString[], reason?: string) => Promise<void>;
2645
823
  /**
2646
824
  * Deletes the initial message response to an interaction.
2647
825
  *
@@ -2655,6 +833,54 @@ export interface RestManager {
2655
833
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
2656
834
  */
2657
835
  deleteOriginalInteractionResponse: (token: string) => Promise<void>;
836
+ /**
837
+ * Deletes a reaction added by the bot user from a message.
838
+ *
839
+ * @param channelId - The ID of the channel the message to delete the reaction from is in.
840
+ * @param messageId - The ID of the message to delete the reaction from.
841
+ * @param reaction - The reaction to delete from the message.
842
+ *
843
+ * @remarks
844
+ * Requires the `READ_MESSAGE_HISTORY` permission.
845
+ *
846
+ * Fires a _Message Reaction Remove_ gateway event.
847
+ *
848
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-own-reaction}
849
+ */
850
+ deleteOwnReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
851
+ /**
852
+ * Deletes all reactions for all emojis from a message.
853
+ *
854
+ * @param channelId - The ID of the channel the message to delete the reactions from is in.
855
+ * @param messageId - The ID of the message to delete the reactions from.
856
+ *
857
+ * @remarks
858
+ * Requires the `READ_MESSAGE_HISTORY` permission.
859
+ *
860
+ * Requires the `MANAGE_MESSAGES` permission.
861
+ *
862
+ * Fires a _Message Reaction Remove All_ gateway event.
863
+ *
864
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions}
865
+ */
866
+ deleteReactionsAll: (channelId: BigString, messageId: BigString) => Promise<void>;
867
+ /**
868
+ * Deletes all reactions for an emoji from a message.
869
+ *
870
+ * @param channelId - The ID of the channel the message to delete the reactions from is in.
871
+ * @param messageId - The ID of the message to delete the reactions from.
872
+ * @param reaction - The reaction to remove from the message.
873
+ *
874
+ * @remarks
875
+ * Requires the `READ_MESSAGE_HISTORY` permission.
876
+ *
877
+ * Requires the `MANAGE_MESSAGES` permission.
878
+ *
879
+ * Fires a _Message Reaction Remove Emoji_ gateway event.
880
+ *
881
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji}
882
+ */
883
+ deleteReactionsEmoji: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
2658
884
  /**
2659
885
  * Deletes a role from a guild.
2660
886
  *
@@ -2696,6 +922,24 @@ export interface RestManager {
2696
922
  * @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
2697
923
  */
2698
924
  deleteStageInstance: (channelId: BigString, reason?: string) => Promise<void>;
925
+ /**
926
+ * Deletes a user's reaction from a message.
927
+ *
928
+ * @param channelId - The ID of the channel the message to delete the reaction from is in.
929
+ * @param messageId - The ID of the message to delete the reaction from.
930
+ * @param userId - The ID of the user whose reaction to delete.
931
+ * @param reaction - The reaction to delete from the message.
932
+ *
933
+ * @remarks
934
+ * Requires the `READ_MESSAGE_HISTORY` permission.
935
+ *
936
+ * Requires the `MANAGE_MESSAGES` permission.
937
+ *
938
+ * Fires a _Message Reaction Remove_ gateway event.
939
+ *
940
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-user-reaction}
941
+ */
942
+ deleteUserReaction: (channelId: BigString, messageId: BigString, userId: BigString, reaction: string) => Promise<void>;
2699
943
  /**
2700
944
  * Deletes a webhook.
2701
945
  *
@@ -2908,6 +1152,8 @@ export interface RestManager {
2908
1152
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
2909
1153
  */
2910
1154
  editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1155
+ /** Modify a guild's MFA level. Requires guild ownership. */
1156
+ editGuildMfaLevel: (guildId: BigString, mfaLevel: MfaLevels, reason?: string) => Promise<void>;
2911
1157
  /**
2912
1158
  * Edit the given sticker.
2913
1159
  *
@@ -2988,6 +1234,24 @@ export interface RestManager {
2988
1234
  editOriginalWebhookMessage: (webhookId: BigString, token: string, options: InteractionCallbackData & {
2989
1235
  threadId?: BigString;
2990
1236
  }) => Promise<Camelize<DiscordMessage>>;
1237
+ /**
1238
+ * Edits the voice state of the bot user.
1239
+ *
1240
+ * @param guildId - The ID of the guild in which to edit the voice state of the bot user.
1241
+ * @param options - The parameters for the edit of the voice state.
1242
+ *
1243
+ * @remarks
1244
+ * The {@link EditOwnVoiceState.channelId | channelId} property of the {@link options} object parameter must point to a stage channel, and the bot user must already have joined it.
1245
+ *
1246
+ * If attempting to unmute oneself:
1247
+ * - Requires the `MUTE_MEMBERS` permission.
1248
+ *
1249
+ * If attempting to request to speak:
1250
+ * - Requires the `REQUEST_TO_SPEAK` permission.
1251
+ *
1252
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
1253
+ */
1254
+ editOwnVoiceState: (guildId: BigString, options: EditOwnVoiceState) => Promise<void>;
2991
1255
  /**
2992
1256
  * Edits a role in a guild.
2993
1257
  *
@@ -3052,6 +1316,20 @@ export interface RestManager {
3052
1316
  * @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
3053
1317
  */
3054
1318
  editStageInstance: (channelId: BigString, data: EditStageInstanceOptions) => Promise<Camelize<DiscordStageInstance>>;
1319
+ /**
1320
+ * Edits the voice state of another user.
1321
+ *
1322
+ * @param guildId - The ID of the guild in which to edit the voice state of the bot user.
1323
+ * @param options - The parameters for the edit of the voice state.
1324
+ *
1325
+ * @remarks
1326
+ * The {@link EditOwnVoiceState.channelId | channelId} property of the {@link options} object parameter must point to a stage channel, and the user must already have joined it.
1327
+ *
1328
+ * Requires the `MUTE_MEMBERS` permission.
1329
+ *
1330
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
1331
+ */
1332
+ editUserVoiceState: (guildId: BigString, options: EditUserVoiceState) => Promise<void>;
3055
1333
  /**
3056
1334
  * Edits a webhook.
3057
1335
  *
@@ -3098,6 +1376,35 @@ export interface RestManager {
3098
1376
  * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
3099
1377
  */
3100
1378
  editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
1379
+ /**
1380
+ * Edits a guild's welcome screen.
1381
+ *
1382
+ * @param guildId - The ID of the guild to edit the welcome screen of.
1383
+ * @param options - The parameters for the edit of the welcome screen.
1384
+ * @returns An instance of the edited {@link WelcomeScreen}.
1385
+ *
1386
+ * @remarks
1387
+ * Requires the `MANAGE_GUILD` permission.
1388
+ *
1389
+ * Fires a _Guild Update_ gateway event.
1390
+ *
1391
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen}
1392
+ */
1393
+ editWelcomeScreen: (guildId: BigString, options: Camelize<DiscordModifyGuildWelcomeScreen>) => Promise<Camelize<DiscordWelcomeScreen>>;
1394
+ /**
1395
+ * Edits the settings of a guild's widget.
1396
+ *
1397
+ * @param guildId - The ID of the guild to edit the settings of the widget of.
1398
+ * @returns An instance of the edited {@link GuildWidgetSettings}.
1399
+ *
1400
+ * @remarks
1401
+ * Requires the `MANAGE_GUILD` permission.
1402
+ *
1403
+ * Fires a _Guild Update_ gateway event.
1404
+ *
1405
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-widget}
1406
+ */
1407
+ editWidgetSettings: (guildId: BigString, options: Camelize<DiscordGuildWidgetSettings>) => Promise<Camelize<DiscordGuildWidgetSettings>>;
3101
1408
  /**
3102
1409
  * Executes a webhook, causing a message to be posted in the channel configured for the webhook.
3103
1410
  *
@@ -3200,6 +1507,12 @@ export interface RestManager {
3200
1507
  * @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
3201
1508
  */
3202
1509
  getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
1510
+ /**
1511
+ * Gets the list of available voice regions.
1512
+ *
1513
+ * @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
1514
+ */
1515
+ getAvailableVoiceRegions: () => Promise<Camelize<DiscordVoiceRegion[]>>;
3203
1516
  /**
3204
1517
  * Gets a ban by user ID.
3205
1518
  *
@@ -3373,6 +1686,18 @@ export interface RestManager {
3373
1686
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
3374
1687
  */
3375
1688
  getGuildApplicationCommands: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
1689
+ /**
1690
+ * Gets the preview of a guild by a guild's ID.
1691
+ *
1692
+ * @param guildId - The ID of the guild to get the preview of.
1693
+ * @returns An instance of {@link GuildPreview}.
1694
+ *
1695
+ * @remarks
1696
+ * If the bot user is not in the guild, the guild must be lurkable.
1697
+ *
1698
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-preview}
1699
+ */
1700
+ getGuildPreview: (guildId: BigString) => Promise<Camelize<DiscordGuildPreview>>;
3376
1701
  /**
3377
1702
  * Returns a sticker object for the given guild and sticker IDs.
3378
1703
  *
@@ -3466,6 +1791,38 @@ export interface RestManager {
3466
1791
  * @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
3467
1792
  */
3468
1793
  getInvites: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
1794
+ /**
1795
+ * Gets a message from a channel by the ID of the message.
1796
+ *
1797
+ * @param channelId - The ID of the channel from which to get the message.
1798
+ * @param messageId - The ID of the message to get.
1799
+ * @returns An instance of {@link Message}.
1800
+ *
1801
+ * @remarks
1802
+ * Requires that the bot user be able to see the contents of the channel in which the message was posted.
1803
+ *
1804
+ * If getting a message from a guild channel:
1805
+ * - Requires the `READ_MESSAGE_HISTORY` permission.
1806
+ *
1807
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message}
1808
+ */
1809
+ getMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
1810
+ /**
1811
+ * Gets multiple messages from a channel.
1812
+ *
1813
+ * @param channelId - The ID of the channel from which to get the messages.
1814
+ * @param options - The parameters for the fetching of the messages.
1815
+ * @returns A collection of {@link Message} objects assorted by message ID.
1816
+ *
1817
+ * @remarks
1818
+ * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
1819
+ *
1820
+ * If getting a messages from a guild channel:
1821
+ * - Requires the `READ_MESSAGE_HISTORY` permission.
1822
+ *
1823
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
1824
+ */
1825
+ getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<Camelize<DiscordMessage[]>>;
3469
1826
  /**
3470
1827
  * Returns the list of sticker packs available to Nitro subscribers.
3471
1828
  *
@@ -3491,6 +1848,21 @@ export interface RestManager {
3491
1848
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
3492
1849
  */
3493
1850
  getOriginalInteractionResponse: (token: string) => Promise<Camelize<DiscordMessage>>;
1851
+ /**
1852
+ * Gets the pinned messages for a channel.
1853
+ *
1854
+ * @param channelId - The ID of the channel to get the pinned messages for.
1855
+ * @returns A collection of {@link Message} objects assorted by message ID.
1856
+ *
1857
+ * @remarks
1858
+ * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
1859
+ *
1860
+ * If getting a message from a guild channel:
1861
+ * - Requires the `READ_MESSAGE_HISTORY` permission.
1862
+ *
1863
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
1864
+ */
1865
+ getPinnedMessages: (channelId: BigString) => Promise<Camelize<DiscordMessage[]>>;
3494
1866
  /**
3495
1867
  * Gets the list of private archived threads for a channel.
3496
1868
  *
@@ -3526,6 +1898,19 @@ export interface RestManager {
3526
1898
  * @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
3527
1899
  */
3528
1900
  getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
1901
+ /**
1902
+ * Gets the number of members that would be kicked from a guild during pruning.
1903
+ *
1904
+ * @param guildId - The ID of the guild to get the prune count of.
1905
+ * @param options - The parameters for the fetching of the prune count.
1906
+ * @returns A number indicating the number of members that would be kicked.
1907
+ *
1908
+ * @remarks
1909
+ * Requires the `KICK_MEMBERS` permission.
1910
+ *
1911
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-prune-count}
1912
+ */
1913
+ getPruneCount: (guildId: BigString, options?: GetGuildPruneCountQuery) => Promise<Camelize<DiscordPrunedCount>>;
3529
1914
  /**
3530
1915
  * Gets the list of public archived threads for a channel.
3531
1916
  *
@@ -3640,6 +2025,18 @@ export interface RestManager {
3640
2025
  * @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
3641
2026
  */
3642
2027
  getThreadMembers: (channelId: BigString) => Promise<Camelize<DiscordThreadMember[]>>;
2028
+ /**
2029
+ * Gets the list of users that reacted with an emoji to a message.
2030
+ *
2031
+ * @param channelId - The ID of the channel the message to get the users for is in.
2032
+ * @param messageId - The ID of the message to get the users for.
2033
+ * @param reaction - The reaction for which to get the users.
2034
+ * @param options - The parameters for the fetching of the users.
2035
+ * @returns A collection of {@link User} objects assorted by user ID.
2036
+ *
2037
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-reactions}
2038
+ */
2039
+ getReactions: (channelId: BigString, messageId: BigString, reaction: string, options?: GetReactions) => Promise<Camelize<DiscordUser[]>>;
3643
2040
  /**
3644
2041
  * Get a user's data from the api
3645
2042
  *
@@ -3704,6 +2101,40 @@ export interface RestManager {
3704
2101
  * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
3705
2102
  */
3706
2103
  getWebhookWithToken: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
2104
+ /**
2105
+ * Gets the welcome screen for a guild.
2106
+ *
2107
+ * @param guildId - The ID of the guild to get the welcome screen for.
2108
+ * @returns An instance of {@link WelcomeScreen}.
2109
+ *
2110
+ * @remarks
2111
+ * If the welcome screen is not enabled:
2112
+ * - Requires the `MANAGE_GUILD` permission.
2113
+ *
2114
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen}
2115
+ */
2116
+ getWelcomeScreen: (guildId: BigString) => Promise<Camelize<DiscordWelcomeScreen>>;
2117
+ /**
2118
+ * Gets the guild widget by guild ID.
2119
+ *
2120
+ * @param guildId - The ID of the guild to get the widget of.
2121
+ * @returns An instance of {@link GuildWidget}.
2122
+ *
2123
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget}
2124
+ */
2125
+ getWidget: (guildId: BigString) => Promise<Camelize<DiscordGuildWidget>>;
2126
+ /**
2127
+ * Gets the settings of a guild's widget.
2128
+ *
2129
+ * @param guildId - The ID of the guild to get the widget of.
2130
+ * @returns An instance of {@link GuildWidgetSettings}.
2131
+ *
2132
+ * @remarks
2133
+ * Requires the `MANAGE_GUILD` permission.
2134
+ *
2135
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-settings}
2136
+ */
2137
+ getWidgetSettings: (guildId: BigString) => Promise<Camelize<DiscordGuildWidgetSettings>>;
3707
2138
  /**
3708
2139
  * Adds the bot user to a thread.
3709
2140
  *
@@ -3717,6 +2148,17 @@ export interface RestManager {
3717
2148
  * @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
3718
2149
  */
3719
2150
  joinThread: (channelId: BigString) => Promise<void>;
2151
+ /**
2152
+ * Leaves a guild.
2153
+ *
2154
+ * @param guildId - The ID of the guild to leave.
2155
+ *
2156
+ * @remarks
2157
+ * Fires a _Guild Delete_ event.
2158
+ *
2159
+ * @see {@link https://discord.com/developers/docs/resources/user#leave-guild}
2160
+ */
2161
+ leaveGuild: (guildId: BigString) => Promise<void>;
3720
2162
  /**
3721
2163
  * Removes the bot user from a thread.
3722
2164
  *
@@ -4031,6 +2473,24 @@ export interface RestManager {
4031
2473
  * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
4032
2474
  */
4033
2475
  kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
2476
+ /**
2477
+ * Pins a message in a channel.
2478
+ *
2479
+ * @param channelId - The ID of the channel where the message is to be pinned.
2480
+ * @param messageId - The ID of the message to pin.
2481
+ *
2482
+ * @remarks
2483
+ * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
2484
+ *
2485
+ * Requires the `MANAGE_MESSAGES` permission.
2486
+ *
2487
+ * ⚠️ There can only be at max 50 messages pinned in a channel.
2488
+ *
2489
+ * Fires a _Channel Pins Update_ event.
2490
+ *
2491
+ * @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
2492
+ */
2493
+ pinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
4034
2494
  /**
4035
2495
  * Initiates the process of pruning inactive members.
4036
2496
  *
@@ -4080,6 +2540,22 @@ export interface RestManager {
4080
2540
  * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
4081
2541
  */
4082
2542
  unbanMember: (guildId: BigString, userId: BigString) => Promise<void>;
2543
+ /**
2544
+ * Unpins a pinned message in a channel.
2545
+ *
2546
+ * @param channelId - The ID of the channel where the message is pinned.
2547
+ * @param messageId - The ID of the message to unpin.
2548
+ *
2549
+ * @remarks
2550
+ * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
2551
+ *
2552
+ * Requires the `MANAGE_MESSAGES` permission.
2553
+ *
2554
+ * Fires a _Channel Pins Update_ event.
2555
+ *
2556
+ * @see {@link https://discord.com/developers/docs/resources/channel#unpin-message}
2557
+ */
2558
+ unpinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
4083
2559
  }
4084
2560
  export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
4085
2561
  export type ApiVersions = 9 | 10;