@discordeno/rest 19.0.0-next.2dafa8f → 19.0.0-next.3264b4e

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, AtLeastOne, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, CreateGuildChannel, CreateGuildEmoji, CreateGuildFromTemplate, CreateGuildRole, CreateGuildStickerOptions, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAuditLog, DiscordAutoModerationRule, DiscordBan, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordGuild, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetBans, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuild, 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. */
@@ -133,6 +139,14 @@ export interface RestManager {
133
139
  reactions: {
134
140
  /** Route for handling a bots reaction. */
135
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;
136
150
  };
137
151
  };
138
152
  /** Routes for guild related endpoints. */
@@ -173,8 +187,22 @@ export interface RestManager {
173
187
  invite: (inviteCode: string, options?: GetInvite) => string;
174
188
  /** Route for handling non-specific invites in a guild. */
175
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;
176
196
  /** Route for handling non-specific webhooks in a guild */
177
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;
178
206
  /** Routes for handling a guild's members. */
179
207
  members: {
180
208
  /** Route for handling a specific guild member's ban. */
@@ -220,6 +248,8 @@ export interface RestManager {
220
248
  stickers: (guildId: BigString) => string;
221
249
  /** Route for handling non-specific guild stickers. */
222
250
  sticker: (guildId: BigString, stickerId: BigString) => string;
251
+ /** Route for handling a voice state. */
252
+ voice: (guildId: BigString, userId?: BigString) => string;
223
253
  };
224
254
  /** Routes for interaction related endpoints. */
225
255
  interactions: {
@@ -253,6 +283,8 @@ export interface RestManager {
253
283
  };
254
284
  /** Route for handling a sticker. */
255
285
  sticker: (stickerId: BigString) => string;
286
+ /** Route for handling all voice regions. */
287
+ regions: () => string;
256
288
  };
257
289
  /** Check the rate limits for a url or a bucket. */
258
290
  checkRateLimits: (url: string) => number | false;
@@ -772,6 +804,22 @@ export interface RestManager {
772
804
  * @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
773
805
  */
774
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>;
775
823
  /**
776
824
  * Deletes the initial message response to an interaction.
777
825
  *
@@ -785,6 +833,54 @@ export interface RestManager {
785
833
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
786
834
  */
787
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>;
788
884
  /**
789
885
  * Deletes a role from a guild.
790
886
  *
@@ -826,6 +922,24 @@ export interface RestManager {
826
922
  * @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
827
923
  */
828
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>;
829
943
  /**
830
944
  * Deletes a webhook.
831
945
  *
@@ -1038,6 +1152,8 @@ export interface RestManager {
1038
1152
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
1039
1153
  */
1040
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>;
1041
1157
  /**
1042
1158
  * Edit the given sticker.
1043
1159
  *
@@ -1118,6 +1234,24 @@ export interface RestManager {
1118
1234
  editOriginalWebhookMessage: (webhookId: BigString, token: string, options: InteractionCallbackData & {
1119
1235
  threadId?: BigString;
1120
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>;
1121
1255
  /**
1122
1256
  * Edits a role in a guild.
1123
1257
  *
@@ -1182,6 +1316,20 @@ export interface RestManager {
1182
1316
  * @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
1183
1317
  */
1184
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>;
1185
1333
  /**
1186
1334
  * Edits a webhook.
1187
1335
  *
@@ -1228,6 +1376,35 @@ export interface RestManager {
1228
1376
  * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
1229
1377
  */
1230
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>>;
1231
1408
  /**
1232
1409
  * Executes a webhook, causing a message to be posted in the channel configured for the webhook.
1233
1410
  *
@@ -1330,6 +1507,12 @@ export interface RestManager {
1330
1507
  * @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
1331
1508
  */
1332
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[]>>;
1333
1516
  /**
1334
1517
  * Gets a ban by user ID.
1335
1518
  *
@@ -1503,6 +1686,18 @@ export interface RestManager {
1503
1686
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
1504
1687
  */
1505
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>>;
1506
1701
  /**
1507
1702
  * Returns a sticker object for the given guild and sticker IDs.
1508
1703
  *
@@ -1596,6 +1791,38 @@ export interface RestManager {
1596
1791
  * @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
1597
1792
  */
1598
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[]>>;
1599
1826
  /**
1600
1827
  * Returns the list of sticker packs available to Nitro subscribers.
1601
1828
  *
@@ -1621,6 +1848,21 @@ export interface RestManager {
1621
1848
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
1622
1849
  */
1623
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[]>>;
1624
1866
  /**
1625
1867
  * Gets the list of private archived threads for a channel.
1626
1868
  *
@@ -1656,6 +1898,19 @@ export interface RestManager {
1656
1898
  * @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
1657
1899
  */
1658
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>>;
1659
1914
  /**
1660
1915
  * Gets the list of public archived threads for a channel.
1661
1916
  *
@@ -1770,6 +2025,18 @@ export interface RestManager {
1770
2025
  * @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
1771
2026
  */
1772
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[]>>;
1773
2040
  /**
1774
2041
  * Get a user's data from the api
1775
2042
  *
@@ -1834,6 +2101,40 @@ export interface RestManager {
1834
2101
  * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
1835
2102
  */
1836
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>>;
1837
2138
  /**
1838
2139
  * Adds the bot user to a thread.
1839
2140
  *
@@ -1847,6 +2148,17 @@ export interface RestManager {
1847
2148
  * @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
1848
2149
  */
1849
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>;
1850
2162
  /**
1851
2163
  * Removes the bot user from a thread.
1852
2164
  *
@@ -2161,6 +2473,24 @@ export interface RestManager {
2161
2473
  * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
2162
2474
  */
2163
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>;
2164
2494
  /**
2165
2495
  * Initiates the process of pruning inactive members.
2166
2496
  *
@@ -2210,6 +2540,22 @@ export interface RestManager {
2210
2540
  * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
2211
2541
  */
2212
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>;
2213
2559
  }
2214
2560
  export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
2215
2561
  export type ApiVersions = 9 | 10;
@@ -2243,7 +2589,7 @@ export interface SendRequestOptions {
2243
2589
  /** Handler to retry a request should it be rate limited. */
2244
2590
  retryRequest?: (options: SendRequestOptions) => Promise<void>;
2245
2591
  /** Resolve handler when a request succeeds. */
2246
- resolve: (value: any | PromiseLike<any>) => void;
2592
+ resolve: (value: RestRequestResponse) => void;
2247
2593
  /** Reject handler when a request fails. */
2248
2594
  reject: (reason?: any) => void;
2249
2595
  /** If this request has a bucket id which it falls under for rate limit */
@@ -2336,4 +2682,9 @@ export interface BeginGuildPrune {
2336
2682
  /** Role(s) ro include, default: none */
2337
2683
  includeRoles?: string[];
2338
2684
  }
2685
+ export interface RestRequestResponse {
2686
+ ok: boolean;
2687
+ status: number;
2688
+ body?: string;
2689
+ }
2339
2690
  //# sourceMappingURL=manager.d.ts.map