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

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, DiscordGuildPreview, DiscordGuildWidget, DiscordGuildWidgetSettings, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordModifyGuildWelcomeScreen, DiscordPrunedCount, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordWebhook, DiscordWelcomeScreen, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, EditOwnVoiceState, EditScheduledEvent, EditStageInstanceOptions, EditUserVoiceState, ExecuteWebhook, GetBans, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetReactions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, MfaLevels, ModifyChannel, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
3
3
  import type { InvalidRequestBucket } from './invalidBucket.js';
4
4
  export declare function createRestManager(options: CreateRestManagerOptions): RestManager;
5
5
  export interface CreateRestManagerOptions {
@@ -80,8 +80,14 @@ export interface RestManager {
80
80
  };
81
81
  /** Routes for channel related endpoints. */
82
82
  channels: {
83
+ /** Route for handling bulk messages in a channel. */
84
+ bulk: (channelId: BigString) => string;
83
85
  /** Route for non-specific dm channel. */
84
86
  dm: () => string;
87
+ /** Route for handling a specific pin. */
88
+ pin: (channelId: BigString, messageId: BigString) => string;
89
+ /** Route for handling a channels pins. */
90
+ pins: (channelId: BigString) => string;
85
91
  /** Route for non-specific webhook in a channel. */
86
92
  webhooks: (channelId: BigString) => string;
87
93
  /** Route for a specific channel. */
@@ -129,11 +135,26 @@ export interface RestManager {
129
135
  };
130
136
  /** Route for handling typing indicators in a c«hannel. */
131
137
  typing: (channelId: BigString) => string;
138
+ /** Routes for handling reactions on a message. */
139
+ reactions: {
140
+ /** Route for handling a bots reaction. */
141
+ bot: (channelId: BigString, messageId: BigString, emoji: string) => string;
142
+ /** Route for handling a user's reactions. */
143
+ user: (channelId: BigString, messageId: BigString, emoji: string, userId: BigString) => string;
144
+ /** Route for handling all the reactions on a message. */
145
+ all: (channelId: BigString, messageId: BigString) => string;
146
+ /** Route for handling all reactions for a single emoji on a message. */
147
+ emoji: (channelId: BigString, messageId: BigString, emoji: string, options?: GetReactions) => string;
148
+ /** Route for handling a specific reaction on a message. */
149
+ message: (channelId: BigString, messageId: BigString, emoji: string, options?: GetReactions) => string;
150
+ };
132
151
  };
133
152
  /** Routes for guild related endpoints. */
134
153
  guilds: {
135
154
  /** Routes for handling a non-specific guild. */
136
155
  all: () => string;
156
+ /** Route for handling audit logs in a guild. */
157
+ auditlogs: (guildId: BigString, options?: GetGuildAuditLog) => string;
137
158
  /** Routes for a guilds automoderation. */
138
159
  automod: {
139
160
  /** Route for handling a guild's automoderation. */
@@ -166,12 +187,28 @@ export interface RestManager {
166
187
  invite: (inviteCode: string, options?: GetInvite) => string;
167
188
  /** Route for handling non-specific invites in a guild. */
168
189
  invites: (guildId: BigString) => string;
190
+ /** Route for handling a bot leaving a guild. */
191
+ leave: (guildId: BigString) => string;
192
+ /** Route for handling a guild's preview. */
193
+ preview: (guildId: BigString) => string;
194
+ /** Route for handling pruning of a guild. */
195
+ prune: (guildId: BigString, options?: GetGuildPruneCountQuery) => string;
169
196
  /** Route for handling non-specific webhooks in a guild */
170
197
  webhooks: (guildId: BigString) => string;
198
+ /** Route for handling a guild's welcome screen. */
199
+ welcome: (guildId: BigString) => string;
200
+ /** Route for handling a guild's widget. */
201
+ widget: (guildId: BigString) => string;
202
+ /** Route for handling a guild's widget in the form of json. */
203
+ widgetJson: (guildId: BigString) => string;
204
+ /** Route for handling a guilds mfa level. */
205
+ mfa: (guildId: BigString) => string;
171
206
  /** Routes for handling a guild's members. */
172
207
  members: {
173
208
  /** Route for handling a specific guild member's ban. */
174
209
  ban: (guildId: BigString, userId: BigString) => string;
210
+ /** Route for handling non-specific bans in a guild. */
211
+ bans: (guildId: BigString, options?: GetBans) => string;
175
212
  /** Route for handling a the bot guild member. */
176
213
  bot: (guildId: BigString) => string;
177
214
  /** Route for handling a specific guild member. */
@@ -194,6 +231,10 @@ export interface RestManager {
194
231
  /** Route for handling non-specific guild's templates. */
195
232
  all: (guildId: BigString) => string;
196
233
  };
234
+ /** Route for handling a guild's vanity url. */
235
+ vanity: (guildId: BigString) => string;
236
+ /** Route for handling a guild's regions. */
237
+ regions: (guildId: BigString) => string;
197
238
  /** Routes for handling a guild's roles. */
198
239
  roles: {
199
240
  /** Route for handling a specific guild role. */
@@ -203,6 +244,12 @@ export interface RestManager {
203
244
  /** Route for handling a members roles in a guild. */
204
245
  member: (guildId: BigString, memberId: BigString, roleId: BigString) => string;
205
246
  };
247
+ /** Route for handling a specific guild sticker. */
248
+ stickers: (guildId: BigString) => string;
249
+ /** Route for handling non-specific guild stickers. */
250
+ sticker: (guildId: BigString, stickerId: BigString) => string;
251
+ /** Route for handling a voice state. */
252
+ voice: (guildId: BigString, userId?: BigString) => string;
206
253
  };
207
254
  /** Routes for interaction related endpoints. */
208
255
  interactions: {
@@ -234,6 +281,10 @@ export interface RestManager {
234
281
  message: (applicationId: BigString, token: string, messageId: BigString) => string;
235
282
  };
236
283
  };
284
+ /** Route for handling a sticker. */
285
+ sticker: (stickerId: BigString) => string;
286
+ /** Route for handling all voice regions. */
287
+ regions: () => string;
237
288
  };
238
289
  /** Check the rate limits for a url or a bucket. */
239
290
  checkRateLimits: (url: string) => number | false;
@@ -263,1761 +314,44 @@ export interface RestManager {
263
314
  delete: (url: string, body?: Record<string, any>) => Promise<void>;
264
315
  /** Make a patch request to the api. */
265
316
  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
- };
317
+ /**
318
+ * Adds a reaction to a message.
319
+ *
320
+ * @param channelId - The ID of the channel the message to add a reaction to is in.
321
+ * @param messageId - The ID of the message to add a reaction to.
322
+ * @param reaction - The reaction to add to the message.
323
+ * @returns
324
+ *
325
+ * @remarks
326
+ * Requires the `READ_MESSAGE_HISTORY` permission.
327
+ *
328
+ * If nobody else has reacted to the message:
329
+ * - Requires the `ADD_REACTIONS` permission.
330
+ *
331
+ * Fires a _Message Reaction Add_ gateway event.
332
+ *
333
+ * @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
334
+ */
335
+ addReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
336
+ /**
337
+ * Adds multiple a reaction to a message.
338
+ *
339
+ * This function uses the `addReaction()` helper behind the scenes.
340
+ *
341
+ * @param channelId - The ID of the channel the message to add reactions to is in.
342
+ * @param messageId - The ID of the message to add the reactions to.
343
+ * @param reactions - The reactions to add to the message.
344
+ * @param ordered - Whether the reactions must be added in order or not.
345
+ *
346
+ * @remarks
347
+ * Requires the `READ_MESSAGE_HISTORY` permission.
348
+ *
349
+ * If nobody else has reacted to the message:
350
+ * - Requires the `ADD_REACTIONS` permission.
351
+ *
352
+ * Fires a _Message Reaction Add_ gateway event for every reaction added.
353
+ */
354
+ addReactions: (channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean) => Promise<void>;
2021
355
  /**
2022
356
  * Adds a role to a member.
2023
357
  *
@@ -2159,6 +493,36 @@ export interface RestManager {
2159
493
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
2160
494
  */
2161
495
  createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
496
+ /**
497
+ * Creates a guild from a template.
498
+ *
499
+ * @param templateCode - The code of the template.
500
+ * @param options - The parameters for the creation of the guild.
501
+ * @returns An instance of the created {@link Guild}.
502
+ *
503
+ * @remarks
504
+ * ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
505
+ *
506
+ * Fires a _Guild Create_ gateway event.
507
+ *
508
+ * @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
509
+ */
510
+ createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<Camelize<DiscordGuild>>;
511
+ /**
512
+ * Create a new sticker for the guild.
513
+ *
514
+ * @param guildId The ID of the guild to get
515
+ * @return A {@link DiscordSticker}
516
+ *
517
+ * @remarks
518
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
519
+ * Fires a Guild Stickers Update Gateway event.
520
+ * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
521
+ * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
522
+ *
523
+ * @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
524
+ */
525
+ createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<Camelize<DiscordSticker>>;
2162
526
  /**
2163
527
  * Creates a template from a guild.
2164
528
  *
@@ -2366,6 +730,21 @@ export interface RestManager {
2366
730
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
2367
731
  */
2368
732
  deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
733
+ /**
734
+ * Delete a new sticker for the guild.
735
+ *
736
+ * @param guildId The ID of the guild to get
737
+ * @return A {@link DiscordSticker}
738
+ *
739
+ * @remarks
740
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
741
+ * Fires a Guild Stickers Update Gateway event.
742
+ * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
743
+ * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
744
+ *
745
+ * @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
746
+ */
747
+ deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
2369
748
  /**
2370
749
  * Deletes a template from a guild.
2371
750
  *
@@ -2425,6 +804,22 @@ export interface RestManager {
2425
804
  * @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
2426
805
  */
2427
806
  deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
807
+ /**
808
+ * Deletes multiple messages from a channel.
809
+ *
810
+ * @param channelId - The ID of the channel to delete the messages from.
811
+ * @param messageIds - The IDs of the messages to delete from the channel.
812
+ *
813
+ * @remarks
814
+ * Requires the `MANAGE_MESSAGES` permission.
815
+ *
816
+ * ⚠️ Messages older than 2 weeks old cannot be deleted.
817
+ *
818
+ * Fires a _Message Delete Bulk_ gateway event.
819
+ *
820
+ * @see {@link https://discord.com/developers/docs/resources/channel#bulk-delete-messages}
821
+ */
822
+ deleteMessages: (channelId: BigString, messageIds: BigString[], reason?: string) => Promise<void>;
2428
823
  /**
2429
824
  * Deletes the initial message response to an interaction.
2430
825
  *
@@ -2438,6 +833,54 @@ export interface RestManager {
2438
833
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
2439
834
  */
2440
835
  deleteOriginalInteractionResponse: (token: string) => Promise<void>;
836
+ /**
837
+ * Deletes a reaction added by the bot user from a message.
838
+ *
839
+ * @param channelId - The ID of the channel the message to delete the reaction from is in.
840
+ * @param messageId - The ID of the message to delete the reaction from.
841
+ * @param reaction - The reaction to delete from the message.
842
+ *
843
+ * @remarks
844
+ * Requires the `READ_MESSAGE_HISTORY` permission.
845
+ *
846
+ * Fires a _Message Reaction Remove_ gateway event.
847
+ *
848
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-own-reaction}
849
+ */
850
+ deleteOwnReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
851
+ /**
852
+ * Deletes all reactions for all emojis from a message.
853
+ *
854
+ * @param channelId - The ID of the channel the message to delete the reactions from is in.
855
+ * @param messageId - The ID of the message to delete the reactions from.
856
+ *
857
+ * @remarks
858
+ * Requires the `READ_MESSAGE_HISTORY` permission.
859
+ *
860
+ * Requires the `MANAGE_MESSAGES` permission.
861
+ *
862
+ * Fires a _Message Reaction Remove All_ gateway event.
863
+ *
864
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions}
865
+ */
866
+ deleteReactionsAll: (channelId: BigString, messageId: BigString) => Promise<void>;
867
+ /**
868
+ * Deletes all reactions for an emoji from a message.
869
+ *
870
+ * @param channelId - The ID of the channel the message to delete the reactions from is in.
871
+ * @param messageId - The ID of the message to delete the reactions from.
872
+ * @param reaction - The reaction to remove from the message.
873
+ *
874
+ * @remarks
875
+ * Requires the `READ_MESSAGE_HISTORY` permission.
876
+ *
877
+ * Requires the `MANAGE_MESSAGES` permission.
878
+ *
879
+ * Fires a _Message Reaction Remove Emoji_ gateway event.
880
+ *
881
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji}
882
+ */
883
+ deleteReactionsEmoji: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
2441
884
  /**
2442
885
  * Deletes a role from a guild.
2443
886
  *
@@ -2479,6 +922,24 @@ export interface RestManager {
2479
922
  * @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
2480
923
  */
2481
924
  deleteStageInstance: (channelId: BigString, reason?: string) => Promise<void>;
925
+ /**
926
+ * Deletes a user's reaction from a message.
927
+ *
928
+ * @param channelId - The ID of the channel the message to delete the reaction from is in.
929
+ * @param messageId - The ID of the message to delete the reaction from.
930
+ * @param userId - The ID of the user whose reaction to delete.
931
+ * @param reaction - The reaction to delete from the message.
932
+ *
933
+ * @remarks
934
+ * Requires the `READ_MESSAGE_HISTORY` permission.
935
+ *
936
+ * Requires the `MANAGE_MESSAGES` permission.
937
+ *
938
+ * Fires a _Message Reaction Remove_ gateway event.
939
+ *
940
+ * @see {@link https://discord.com/developers/docs/resources/channel#delete-user-reaction}
941
+ */
942
+ deleteUserReaction: (channelId: BigString, messageId: BigString, userId: BigString, reaction: string) => Promise<void>;
2482
943
  /**
2483
944
  * Deletes a webhook.
2484
945
  *
@@ -2661,6 +1122,25 @@ export interface RestManager {
2661
1122
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
2662
1123
  */
2663
1124
  editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1125
+ /**
1126
+ * Edits a guild's settings.
1127
+ *
1128
+ * @param guildId - The ID of the guild to edit.
1129
+ * @param shardId - The ID of the shard the guild is in.
1130
+ * @param options - The parameters for the edit of the guild.
1131
+ * @returns An instance of the edited {@link Guild}.
1132
+ *
1133
+ * @remarks
1134
+ * Requires the `MANAGE_GUILD` permission.
1135
+ *
1136
+ * If attempting to add or remove the {@link GuildFeatures.Community} feature:
1137
+ * - Requires the `ADMINISTRATOR` permission.
1138
+ *
1139
+ * Fires a _Guild Update_ gateway event.
1140
+ *
1141
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
1142
+ */
1143
+ editGuild: (guildId: BigString, options: ModifyGuild) => Promise<Camelize<DiscordGuild>>;
2664
1144
  /**
2665
1145
  * Edits an application command registered in a guild.
2666
1146
  *
@@ -2672,6 +1152,21 @@ export interface RestManager {
2672
1152
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
2673
1153
  */
2674
1154
  editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1155
+ /** Modify a guild's MFA level. Requires guild ownership. */
1156
+ editGuildMfaLevel: (guildId: BigString, mfaLevel: MfaLevels, reason?: string) => Promise<void>;
1157
+ /**
1158
+ * Edit the given sticker.
1159
+ *
1160
+ * @param guildId The ID of the guild to get
1161
+ * @return A {@link DiscordSticker}
1162
+ *
1163
+ * @remarks
1164
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
1165
+ * Fires a Guild Stickers Update Gateway event.
1166
+ *
1167
+ * @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
1168
+ */
1169
+ editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>) => Promise<Camelize<DiscordSticker>>;
2675
1170
  /**
2676
1171
  * Edits a template's settings.
2677
1172
  *
@@ -2739,6 +1234,24 @@ export interface RestManager {
2739
1234
  editOriginalWebhookMessage: (webhookId: BigString, token: string, options: InteractionCallbackData & {
2740
1235
  threadId?: BigString;
2741
1236
  }) => Promise<Camelize<DiscordMessage>>;
1237
+ /**
1238
+ * Edits the voice state of the bot user.
1239
+ *
1240
+ * @param guildId - The ID of the guild in which to edit the voice state of the bot user.
1241
+ * @param options - The parameters for the edit of the voice state.
1242
+ *
1243
+ * @remarks
1244
+ * The {@link EditOwnVoiceState.channelId | channelId} property of the {@link options} object parameter must point to a stage channel, and the bot user must already have joined it.
1245
+ *
1246
+ * If attempting to unmute oneself:
1247
+ * - Requires the `MUTE_MEMBERS` permission.
1248
+ *
1249
+ * If attempting to request to speak:
1250
+ * - Requires the `REQUEST_TO_SPEAK` permission.
1251
+ *
1252
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
1253
+ */
1254
+ editOwnVoiceState: (guildId: BigString, options: EditOwnVoiceState) => Promise<void>;
2742
1255
  /**
2743
1256
  * Edits a role in a guild.
2744
1257
  *
@@ -2803,6 +1316,20 @@ export interface RestManager {
2803
1316
  * @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
2804
1317
  */
2805
1318
  editStageInstance: (channelId: BigString, data: EditStageInstanceOptions) => Promise<Camelize<DiscordStageInstance>>;
1319
+ /**
1320
+ * Edits the voice state of another user.
1321
+ *
1322
+ * @param guildId - The ID of the guild in which to edit the voice state of the bot user.
1323
+ * @param options - The parameters for the edit of the voice state.
1324
+ *
1325
+ * @remarks
1326
+ * The {@link EditOwnVoiceState.channelId | channelId} property of the {@link options} object parameter must point to a stage channel, and the user must already have joined it.
1327
+ *
1328
+ * Requires the `MUTE_MEMBERS` permission.
1329
+ *
1330
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
1331
+ */
1332
+ editUserVoiceState: (guildId: BigString, options: EditUserVoiceState) => Promise<void>;
2806
1333
  /**
2807
1334
  * Edits a webhook.
2808
1335
  *
@@ -2849,6 +1376,35 @@ export interface RestManager {
2849
1376
  * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
2850
1377
  */
2851
1378
  editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
1379
+ /**
1380
+ * Edits a guild's welcome screen.
1381
+ *
1382
+ * @param guildId - The ID of the guild to edit the welcome screen of.
1383
+ * @param options - The parameters for the edit of the welcome screen.
1384
+ * @returns An instance of the edited {@link WelcomeScreen}.
1385
+ *
1386
+ * @remarks
1387
+ * Requires the `MANAGE_GUILD` permission.
1388
+ *
1389
+ * Fires a _Guild Update_ gateway event.
1390
+ *
1391
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen}
1392
+ */
1393
+ editWelcomeScreen: (guildId: BigString, options: Camelize<DiscordModifyGuildWelcomeScreen>) => Promise<Camelize<DiscordWelcomeScreen>>;
1394
+ /**
1395
+ * Edits the settings of a guild's widget.
1396
+ *
1397
+ * @param guildId - The ID of the guild to edit the settings of the widget of.
1398
+ * @returns An instance of the edited {@link GuildWidgetSettings}.
1399
+ *
1400
+ * @remarks
1401
+ * Requires the `MANAGE_GUILD` permission.
1402
+ *
1403
+ * Fires a _Guild Update_ gateway event.
1404
+ *
1405
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-widget}
1406
+ */
1407
+ editWidgetSettings: (guildId: BigString, options: Camelize<DiscordGuildWidgetSettings>) => Promise<Camelize<DiscordGuildWidgetSettings>>;
2852
1408
  /**
2853
1409
  * Executes a webhook, causing a message to be posted in the channel configured for the webhook.
2854
1410
  *
@@ -2913,6 +1469,19 @@ export interface RestManager {
2913
1469
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
2914
1470
  */
2915
1471
  getApplicationCommandPermissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
1472
+ /**
1473
+ * Gets a guild's audit log.
1474
+ *
1475
+ * @param guildId - The ID of the guild to get the audit log of.
1476
+ * @param options - The parameters for the fetching of the audit log.
1477
+ * @returns An instance of {@link AuditLog}.
1478
+ *
1479
+ * @remarks
1480
+ * Requires the `VIEW_AUDIT_LOG` permission.
1481
+ *
1482
+ * @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
1483
+ */
1484
+ getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
2916
1485
  /**
2917
1486
  * Gets an automod rule by its ID.
2918
1487
  *
@@ -2938,6 +1507,40 @@ export interface RestManager {
2938
1507
  * @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
2939
1508
  */
2940
1509
  getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
1510
+ /**
1511
+ * Gets the list of available voice regions.
1512
+ *
1513
+ * @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
1514
+ */
1515
+ getAvailableVoiceRegions: () => Promise<Camelize<DiscordVoiceRegion[]>>;
1516
+ /**
1517
+ * Gets a ban by user ID.
1518
+ *
1519
+ * @param guildId - The ID of the guild to get the ban from.
1520
+ * @param userId - The ID of the user to get the ban for.
1521
+ * @returns An instance of {@link DiscordBan}.
1522
+ *
1523
+ * @remarks
1524
+ * Requires the `BAN_MEMBERS` permission.
1525
+ *
1526
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
1527
+ */
1528
+ getBan: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
1529
+ /**
1530
+ * Gets the list of bans for a guild.
1531
+ *
1532
+ * @param guildId - The ID of the guild to get the list of bans for.
1533
+ * @param options - The parameters for the fetching of the list of bans.
1534
+ * @returns A collection of {@link DiscordBan} objects assorted by user ID.
1535
+ *
1536
+ * @remarks
1537
+ * Requires the `BAN_MEMBERS` permission.
1538
+ *
1539
+ * Users are ordered by their IDs in _ascending_ order.
1540
+ *
1541
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
1542
+ */
1543
+ getBans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan[]>>;
2941
1544
  /**
2942
1545
  * Gets a channel by its ID.
2943
1546
  *
@@ -3052,6 +1655,18 @@ export interface RestManager {
3052
1655
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
3053
1656
  */
3054
1657
  getGlobalApplicationCommands: () => Promise<Camelize<DiscordApplicationCommand[]>>;
1658
+ /**
1659
+ * Gets a guild by its ID.
1660
+ *
1661
+ * @param guildId - The ID of the guild to get.
1662
+ * @param options - The parameters for the fetching of the guild.
1663
+ * @returns An instance of {@link Guild}.
1664
+ *
1665
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
1666
+ */
1667
+ getGuild: (guildId: BigString, options?: {
1668
+ counts?: boolean;
1669
+ }) => Promise<Camelize<DiscordGuild>>;
3055
1670
  /**
3056
1671
  * Gets a guild application command by its ID.
3057
1672
  *
@@ -3071,6 +1686,41 @@ export interface RestManager {
3071
1686
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
3072
1687
  */
3073
1688
  getGuildApplicationCommands: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
1689
+ /**
1690
+ * Gets the preview of a guild by a guild's ID.
1691
+ *
1692
+ * @param guildId - The ID of the guild to get the preview of.
1693
+ * @returns An instance of {@link GuildPreview}.
1694
+ *
1695
+ * @remarks
1696
+ * If the bot user is not in the guild, the guild must be lurkable.
1697
+ *
1698
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-preview}
1699
+ */
1700
+ getGuildPreview: (guildId: BigString) => Promise<Camelize<DiscordGuildPreview>>;
1701
+ /**
1702
+ * Returns a sticker object for the given guild and sticker IDs.
1703
+ *
1704
+ * @param guildId The ID of the guild to get
1705
+ * @param stickerId The ID of the sticker to get
1706
+ * @return A {@link DiscordSticker}
1707
+ *
1708
+ * @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
1709
+ *
1710
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
1711
+ */
1712
+ getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
1713
+ /**
1714
+ * Returns an array of sticker objects for the given guild.
1715
+ *
1716
+ * @param guildId The ID of the guild to get
1717
+ * @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
1718
+ *
1719
+ * @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
1720
+ *
1721
+ * @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
1722
+ */
1723
+ getGuildStickers: (guildId: BigString) => Promise<Camelize<DiscordSticker[]>>;
3074
1724
  /**
3075
1725
  * Gets a template by its code.
3076
1726
  *
@@ -3141,6 +1791,38 @@ export interface RestManager {
3141
1791
  * @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
3142
1792
  */
3143
1793
  getInvites: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
1794
+ /**
1795
+ * Gets a message from a channel by the ID of the message.
1796
+ *
1797
+ * @param channelId - The ID of the channel from which to get the message.
1798
+ * @param messageId - The ID of the message to get.
1799
+ * @returns An instance of {@link Message}.
1800
+ *
1801
+ * @remarks
1802
+ * Requires that the bot user be able to see the contents of the channel in which the message was posted.
1803
+ *
1804
+ * If getting a message from a guild channel:
1805
+ * - Requires the `READ_MESSAGE_HISTORY` permission.
1806
+ *
1807
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message}
1808
+ */
1809
+ getMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
1810
+ /**
1811
+ * Gets multiple messages from a channel.
1812
+ *
1813
+ * @param channelId - The ID of the channel from which to get the messages.
1814
+ * @param options - The parameters for the fetching of the messages.
1815
+ * @returns A collection of {@link Message} objects assorted by message ID.
1816
+ *
1817
+ * @remarks
1818
+ * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
1819
+ *
1820
+ * If getting a messages from a guild channel:
1821
+ * - Requires the `READ_MESSAGE_HISTORY` permission.
1822
+ *
1823
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
1824
+ */
1825
+ getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<Camelize<DiscordMessage[]>>;
3144
1826
  /**
3145
1827
  * Returns the list of sticker packs available to Nitro subscribers.
3146
1828
  *
@@ -3166,6 +1848,21 @@ export interface RestManager {
3166
1848
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
3167
1849
  */
3168
1850
  getOriginalInteractionResponse: (token: string) => Promise<Camelize<DiscordMessage>>;
1851
+ /**
1852
+ * Gets the pinned messages for a channel.
1853
+ *
1854
+ * @param channelId - The ID of the channel to get the pinned messages for.
1855
+ * @returns A collection of {@link Message} objects assorted by message ID.
1856
+ *
1857
+ * @remarks
1858
+ * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
1859
+ *
1860
+ * If getting a message from a guild channel:
1861
+ * - Requires the `READ_MESSAGE_HISTORY` permission.
1862
+ *
1863
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
1864
+ */
1865
+ getPinnedMessages: (channelId: BigString) => Promise<Camelize<DiscordMessage[]>>;
3169
1866
  /**
3170
1867
  * Gets the list of private archived threads for a channel.
3171
1868
  *
@@ -3201,6 +1898,19 @@ export interface RestManager {
3201
1898
  * @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
3202
1899
  */
3203
1900
  getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
1901
+ /**
1902
+ * Gets the number of members that would be kicked from a guild during pruning.
1903
+ *
1904
+ * @param guildId - The ID of the guild to get the prune count of.
1905
+ * @param options - The parameters for the fetching of the prune count.
1906
+ * @returns A number indicating the number of members that would be kicked.
1907
+ *
1908
+ * @remarks
1909
+ * Requires the `KICK_MEMBERS` permission.
1910
+ *
1911
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-prune-count}
1912
+ */
1913
+ getPruneCount: (guildId: BigString, options?: GetGuildPruneCountQuery) => Promise<Camelize<DiscordPrunedCount>>;
3204
1914
  /**
3205
1915
  * Gets the list of public archived threads for a channel.
3206
1916
  *
@@ -3284,6 +1994,15 @@ export interface RestManager {
3284
1994
  * @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
3285
1995
  */
3286
1996
  getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
1997
+ /**
1998
+ * Returns a sticker object for the given sticker ID.
1999
+ *
2000
+ * @param stickerId The ID of the sticker to get
2001
+ * @returns A {@link DiscordSticker}
2002
+ *
2003
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
2004
+ */
2005
+ getSticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
3287
2006
  /**
3288
2007
  * Gets a thread member by their user ID.
3289
2008
  *
@@ -3306,6 +2025,18 @@ export interface RestManager {
3306
2025
  * @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
3307
2026
  */
3308
2027
  getThreadMembers: (channelId: BigString) => Promise<Camelize<DiscordThreadMember[]>>;
2028
+ /**
2029
+ * Gets the list of users that reacted with an emoji to a message.
2030
+ *
2031
+ * @param channelId - The ID of the channel the message to get the users for is in.
2032
+ * @param messageId - The ID of the message to get the users for.
2033
+ * @param reaction - The reaction for which to get the users.
2034
+ * @param options - The parameters for the fetching of the users.
2035
+ * @returns A collection of {@link User} objects assorted by user ID.
2036
+ *
2037
+ * @see {@link https://discord.com/developers/docs/resources/channel#get-reactions}
2038
+ */
2039
+ getReactions: (channelId: BigString, messageId: BigString, reaction: string, options?: GetReactions) => Promise<Camelize<DiscordUser[]>>;
3309
2040
  /**
3310
2041
  * Get a user's data from the api
3311
2042
  *
@@ -3313,6 +2044,29 @@ export interface RestManager {
3313
2044
  * @returns {Camelize<DiscordUser>}
3314
2045
  */
3315
2046
  getUser: (id: BigString) => Promise<Camelize<DiscordUser>>;
2047
+ /**
2048
+ * Gets information about the vanity url of a guild.
2049
+ *
2050
+ * @param guildId - The ID of the guild to get the vanity url information for.
2051
+ * @returns An instance of {@link VanityUrl}.
2052
+ *
2053
+ * @remarks
2054
+ * Requires the `MANAGE_GUILD` permission.
2055
+ *
2056
+ * The `code` property will be `null` if the guild does not have a set vanity url.
2057
+ *
2058
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
2059
+ */
2060
+ getVanityUrl: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
2061
+ /**
2062
+ * Gets the list of voice regions for a guild.
2063
+ *
2064
+ * @param guildId - The ID of the guild to get the voice regions for.
2065
+ * @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
2066
+ *
2067
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
2068
+ */
2069
+ getVoiceRegions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion[]>>;
3316
2070
  /**
3317
2071
  * Gets a webhook by its ID.
3318
2072
  *
@@ -3347,6 +2101,40 @@ export interface RestManager {
3347
2101
  * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
3348
2102
  */
3349
2103
  getWebhookWithToken: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
2104
+ /**
2105
+ * Gets the welcome screen for a guild.
2106
+ *
2107
+ * @param guildId - The ID of the guild to get the welcome screen for.
2108
+ * @returns An instance of {@link WelcomeScreen}.
2109
+ *
2110
+ * @remarks
2111
+ * If the welcome screen is not enabled:
2112
+ * - Requires the `MANAGE_GUILD` permission.
2113
+ *
2114
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen}
2115
+ */
2116
+ getWelcomeScreen: (guildId: BigString) => Promise<Camelize<DiscordWelcomeScreen>>;
2117
+ /**
2118
+ * Gets the guild widget by guild ID.
2119
+ *
2120
+ * @param guildId - The ID of the guild to get the widget of.
2121
+ * @returns An instance of {@link GuildWidget}.
2122
+ *
2123
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget}
2124
+ */
2125
+ getWidget: (guildId: BigString) => Promise<Camelize<DiscordGuildWidget>>;
2126
+ /**
2127
+ * Gets the settings of a guild's widget.
2128
+ *
2129
+ * @param guildId - The ID of the guild to get the widget of.
2130
+ * @returns An instance of {@link GuildWidgetSettings}.
2131
+ *
2132
+ * @remarks
2133
+ * Requires the `MANAGE_GUILD` permission.
2134
+ *
2135
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-settings}
2136
+ */
2137
+ getWidgetSettings: (guildId: BigString) => Promise<Camelize<DiscordGuildWidgetSettings>>;
3350
2138
  /**
3351
2139
  * Adds the bot user to a thread.
3352
2140
  *
@@ -3360,6 +2148,17 @@ export interface RestManager {
3360
2148
  * @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
3361
2149
  */
3362
2150
  joinThread: (channelId: BigString) => Promise<void>;
2151
+ /**
2152
+ * Leaves a guild.
2153
+ *
2154
+ * @param guildId - The ID of the guild to leave.
2155
+ *
2156
+ * @remarks
2157
+ * Fires a _Guild Delete_ event.
2158
+ *
2159
+ * @see {@link https://discord.com/developers/docs/resources/user#leave-guild}
2160
+ */
2161
+ leaveGuild: (guildId: BigString) => Promise<void>;
3363
2162
  /**
3364
2163
  * Removes the bot user from a thread.
3365
2164
  *
@@ -3674,6 +2473,24 @@ export interface RestManager {
3674
2473
  * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
3675
2474
  */
3676
2475
  kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
2476
+ /**
2477
+ * Pins a message in a channel.
2478
+ *
2479
+ * @param channelId - The ID of the channel where the message is to be pinned.
2480
+ * @param messageId - The ID of the message to pin.
2481
+ *
2482
+ * @remarks
2483
+ * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
2484
+ *
2485
+ * Requires the `MANAGE_MESSAGES` permission.
2486
+ *
2487
+ * ⚠️ There can only be at max 50 messages pinned in a channel.
2488
+ *
2489
+ * Fires a _Channel Pins Update_ event.
2490
+ *
2491
+ * @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
2492
+ */
2493
+ pinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
3677
2494
  /**
3678
2495
  * Initiates the process of pruning inactive members.
3679
2496
  *
@@ -3723,6 +2540,22 @@ export interface RestManager {
3723
2540
  * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
3724
2541
  */
3725
2542
  unbanMember: (guildId: BigString, userId: BigString) => Promise<void>;
2543
+ /**
2544
+ * Unpins a pinned message in a channel.
2545
+ *
2546
+ * @param channelId - The ID of the channel where the message is pinned.
2547
+ * @param messageId - The ID of the message to unpin.
2548
+ *
2549
+ * @remarks
2550
+ * Requires that the bot user be able to see the contents of the channel in which the messages were posted.
2551
+ *
2552
+ * Requires the `MANAGE_MESSAGES` permission.
2553
+ *
2554
+ * Fires a _Channel Pins Update_ event.
2555
+ *
2556
+ * @see {@link https://discord.com/developers/docs/resources/channel#unpin-message}
2557
+ */
2558
+ unpinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
3726
2559
  }
3727
2560
  export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
3728
2561
  export type ApiVersions = 9 | 10;
@@ -3756,9 +2589,9 @@ export interface SendRequestOptions {
3756
2589
  /** Handler to retry a request should it be rate limited. */
3757
2590
  retryRequest?: (options: SendRequestOptions) => Promise<void>;
3758
2591
  /** Resolve handler when a request succeeds. */
3759
- resolve: (value: any | PromiseLike<any>) => void;
2592
+ resolve: (value: RestRequestResponse) => void;
3760
2593
  /** Reject handler when a request fails. */
3761
- reject: (reason?: any) => void;
2594
+ reject: (value: RestRequestRejection) => void;
3762
2595
  /** If this request has a bucket id which it falls under for rate limit */
3763
2596
  bucketId?: string;
3764
2597
  /** Additional request options, used for things like overriding authorization header. */
@@ -3849,4 +2682,15 @@ export interface BeginGuildPrune {
3849
2682
  /** Role(s) ro include, default: none */
3850
2683
  includeRoles?: string[];
3851
2684
  }
2685
+ export interface RestRequestResponse {
2686
+ ok: boolean;
2687
+ status: number;
2688
+ body?: string;
2689
+ }
2690
+ export interface RestRequestRejection {
2691
+ ok: boolean;
2692
+ status: number;
2693
+ body?: string;
2694
+ error?: string;
2695
+ }
3852
2696
  //# sourceMappingURL=manager.d.ts.map