@discordeno/rest 19.0.0-next.9d5b8df → 19.0.0-next.a4bf82f

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