distype - v3.0.1
    Preparing search index...

    Class Rest

    The rest manager. Used for making rest requests to the Discord API.

    Hierarchy

    • RestRequests
      • Rest
    Index

    Constructors

    Properties

    Accessors

    Methods

    addGuildMember addGuildMemberRole addThreadMember beginGuildPrune bulkDeleteMessages bulkOverwriteGlobalApplicationCommands bulkOverwriteGuildApplicationCommands createAutoModerationRule createChannelInvite createDM createFollowupMessage createGlobalApplicationCommand createGuild createGuildApplicationCommand createGuildBan createGuildChannel createGuildEmoji createGuildRole createGuildScheduledEvent createGuildSticker createInteractionResponse createMessage createReaction createStageInstance createWebhook crosspostMessage deleteAllReactions deleteAllReactionsForEmoji deleteAutoModerationRule deleteChannel deleteChannelPermission deleteFollowupMessage deleteGlobalApplicationCommand deleteGuild deleteGuildApplicationCommand deleteGuildEmoji deleteGuildIntegration deleteGuildRole deleteGuildScheduledEvent deleteGuildSticker deleteInvite deleteMessage deleteOriginalInteractionResponse deleteOwnReaction deleteStageInstance deleteUserReaction deleteWebhook deleteWebhookMessage deleteWebhookWithToken editApplicationCommandPermissions editChannelPermissions editFollowupMessage editGlobalApplicationCommand editGuildApplicationCommand editMessage editOriginalInteractionResponse editWebhookMessage executeWebhook followNewsChannel getApplicationCommandPermissions getAutoModerationRule getChannel getChannelInvites getChannelMessage getChannelMessages getChannelWebhooks getCurrentAuthorizationInformation getCurrentBotApplicationInformation getCurrentUser getCurrentUserGuildMember getCurrentUserGuilds getFollowupMessage getGateway getGatewayBot getGlobalApplicationCommand getGlobalApplicationCommands getGuild getGuildApplicationCommand getGuildApplicationCommandPermissions getGuildApplicationCommands getGuildAuditLog getGuildBan getGuildBans getGuildChannels getGuildEmoji getGuildIntegrations getGuildInvites getGuildMember getGuildPreview getGuildPruneCount getGuildRoles getGuildScheduledEvent getGuildScheduledEventUsers getGuildSticker getGuildVanityURL getGuildVoiceRegions getGuildWebhooks getGuildWelcomeScreen getGuildWidget getGuildWidgetSettings getInvite getOriginalInteractionResponse getPinnedMessages getReactions getStageInstance getSticker getUser getUserConnections getWebhook getWebhookMessage getWebhookWithToken groupDMAddRecipient groupDMRemoveRecipient joinThread leaveGuild leaveThread listActiveThreads listAutoModerationRulesForGuild listGuildEmojis listGuildMembers listGuildStickers listJoinedPrivateArchivedThreads listNitroStickerPacks listPrivateArchivedThreads listPublicArchivedThreads listScheduledEventsForGuild listThreadMembers listVoiceRegions make modifyAutoModerationRule modifyChannel modifyCurrentMember modifyCurrentUser modifyCurrentUserVoiceState modifyGuild modifyGuildChannelPositions modifyGuildEmoji modifyGuildMember modifyGuildMFALevel modifyGuildRole modifyGuildRolePositions modifyGuildScheduledEvent modifyGuildSticker modifyGuildWelcomeScreen modifyGuildWidget modifyStageInstance modifyUserVoiceState modifyWebhook modifyWebhookWithToken pinMessage removeGuildBan removeGuildMember removeGuildMemberRole removeThreadMember request searchGuildMembers startThreadFromMessage startThreadInForumChannel startThreadWithoutMessage sweepBuckets triggerTypingIndicator unpinMessage

    Constructors

    Properties

    buckets: null | ExtendedMap<`${string}(${string})`, RestBucket> = null

    Rate limit buckets. Each bucket's key is it's ID.

    bucketSweepInterval: null | Timer = null

    The interval used for sweeping inactive buckets.

    globalLeft: null | number = null

    The amount of requests left in the global rate limit bucket.

    globalResetAt: null | number = null

    A unix millisecond timestamp at which the global rate limit resets.

    options: Required<RestOptions> & RestRequestOptions & { version: number }

    Options for the rest manager.

    responseCodeTally: Record<string, number> = {}

    A tally of the number of responses that returned a specific response code. Note that response codes aren't included if they were never received.

    routeHashCache:
        | null
        | ExtendedMap<
            | `GET;${string}`
            | `POST;${string}`
            | `PUT;${string}`
            | `DELETE;${string}`
            | `PATCH;${string}`,
            string,
        > = null

    Cached route rate limit bucket hashes. Keys are cached route hashes, with their values being their corresponding RestBucketHash bucket hash.

    system: "Rest" = ...

    The system string used for logging.

    API_VERSION: 10

    The default REST API version used.

    BASE_URL: "https://discord.com/api" = ...

    Discord's base API URL.

    ERROR_KEY: "_errors" = ...

    The ending key where an error array is defined on a rest error.

    OLD_MESSAGE_THRESHOLD: 1209600000

    The amount of milliseconds after a message is created where it causes issues with rate limiting.

    Accessors

    • get responseCodeRatio(): Record<string, number>

      Get the ratio of response codes. Each code's value is the percentage it was received (0 to 100). Note that response codes aren't included if they were never received.

      Returns Record<string, number>

    Methods

    • Parameters

      • guildId: string

        The guild ID.

      • userId: string

        The user ID.

      • body: RESTPutAPIGuildMemberJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTPutAPIGuildMemberResult>

    • Parameters

      • guildId: string

        The guild ID.

      • userId: string

        The user ID.

      • roleId: string

        The role ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPostAPIGuildPruneJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTPostAPIGuildPruneResult>

    • Parameters

      • channelId: string

        The channel ID.

      • body: RESTPostAPIChannelMessagesBulkDeleteJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • applicationId: string

        The application ID.

      • body: RESTPutAPIApplicationCommandsJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTPutAPIApplicationCommandsResult>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • body: RESTPutAPIApplicationGuildCommandsJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTPutAPIApplicationGuildCommandsResult>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPostAPIAutoModerationRuleJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIAutoModerationRule>

    • Parameters

      • channelId: string

        The channel ID.

      • body: RESTPostAPIChannelInviteJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIExtendedInvite>

    • Parameters

      • applicationId: string

        The application ID.

      • interactionToken: string

        The interaction token.

      • body: FormData | APIInteractionResponseCallbackData

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Parameters

      • applicationId: string

        The application ID.

      • body: RESTPostAPIApplicationCommandsJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIApplicationCommand>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • body: RESTPostAPIApplicationGuildCommandsJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTPostAPIApplicationGuildCommandsResult>

    • Parameters

      • guildId: string

        The guild ID.

      • userId: string

        The user ID.

      • body: RESTPutAPIGuildBanJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPostAPIGuildChannelJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIChannel>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPostAPIGuildEmojiJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIEmoji>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPostAPIGuildRoleJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIRole>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPostAPIGuildScheduledEventJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildScheduledEvent>

    • Parameters

      • guildId: string

        The guild ID.

      • body: FormData

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APISticker>

    • Parameters

      • interactionId: string

        The interaction ID.

      • interactionToken: string

        The interaction token.

      • body: FormData | APIInteractionResponse

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • channelId: string

        The channel ID.

      • body: FormData | RESTPostAPIChannelMessageJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • emoji: string

        The emoji's identifier.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • body: RESTPostAPIStageInstanceJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIStageInstance>

    • Parameters

      • channelId: string

        The channel ID.

      • body: RESTPostAPIChannelWebhookJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIWebhook>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • emoji: string

        The emoji's identifier.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • autoModerationRuleId: string

        The auto moderation rule ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • channelId: string

        The channel ID.

      • overwriteId: string

        The overwrite's ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • applicationId: string

        The application ID.

      • interactionToken: string

        The interaction token.

      • messageId: string

        The message ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • applicationId: string

        The application ID.

      • commandId: string

        The command ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • commandId: string

        The command ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • emoji: string

        The emoji's identifier.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • integrationId: string

        The integration ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • roleId: string

        The role ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • stickerId: string

        The sticker ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • applicationId: string

        The application ID.

      • interactionToken: string

        The interaction token.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • emoji: string

        The emoji's identifier.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • emoji: string

        The emoji's identifier.

      • userId: string

        The user ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • webhookId: string

        The webhook ID.

      • token: string

        The webhook's token.

      • messageId: string

        The message ID.

      • OptionalthreadId: string

        The thread ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • webhookId: string

        The webhook ID.

      • token: string
      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • commandId: string

        The command ID.

      • body: RESTPutAPIApplicationCommandPermissionsJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildApplicationCommandPermissions>

    • Parameters

      • channelId: string

        The channel ID.

      • overwriteId: string

        The overwrite ID.

      • body: RESTPutAPIChannelPermissionJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • applicationId: string

        The application ID.

      • interactionToken: string

        The interaction token.

      • messageId: string

        The message ID.

      • body: FormData | RESTPatchAPIWebhookWithTokenMessageJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Parameters

      • applicationId: string

        The application ID.

      • commandId: string

        The command ID.

      • body: RESTPatchAPIApplicationCommandJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIApplicationCommand>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • commandId: string

        The command ID.

      • body: RESTPatchAPIApplicationGuildCommandJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTPatchAPIApplicationGuildCommandResult>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • body: FormData | RESTPatchAPIChannelMessageJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Parameters

      • applicationId: string

        The application ID.

      • interactionToken: string

        The interaction token.

      • body: FormData | RESTPatchAPIWebhookWithTokenMessageJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Parameters

      • webhookId: string

        The webhook ID.

      • token: string

        The webhook's token.

      • messageId: string

        The message ID.

      • body: FormData | RESTPatchAPIWebhookWithTokenMessageJSONBody
      • OptionalthreadId: string

        The thread ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Type Parameters

      • T extends boolean = false

      Parameters

      • webhookId: string

        The webhook ID.

      • token: string

        The webhook's token.

      • body: FormData | RESTPostAPIWebhookWithTokenJSONBody

        Request body.

      • Optionalwait: T

        If the response should wait until server confirmation.

      • OptionalthreadId: string

        The thread ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<T extends true ? APIMessage : never>

    • Parameters

      • channelId: string

        The channel ID.

      • body: RESTPostAPIChannelFollowersJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIFollowedChannel>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • commandId: string

        The command ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildApplicationCommandPermissions>

    • Parameters

      • guildId: string

        The guild ID.

      • autoModerationRuleId: string

        The auto moderation rule ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIAutoModerationRule>

    • Parameters

      • channelId: string

        The channel ID.

      • query: RESTGetAPIChannelMessagesQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIChannelMessagesResult>

    • Parameters

      • query: RESTGetAPICurrentUserGuildsQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPICurrentUserGuildsResult>

    • Parameters

      • applicationId: string

        The application ID.

      • interactionToken: string

        The interaction token.

      • messageId: string

        The message ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Parameters

      • applicationId: string

        The application ID.

      • commandId: string

        The command ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIApplicationCommand>

    • Parameters

      • applicationId: string

        The application ID.

      • query: RESTGetAPIApplicationCommandsQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIApplicationCommandsResult>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • commandId: string

        The command ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIApplicationGuildCommandResult>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIGuildApplicationCommandsPermissionsResult>

    • Parameters

      • applicationId: string

        The application ID.

      • guildId: string

        The guild ID.

      • query: RESTGetAPIApplicationCommandsQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIApplicationGuildCommandsResult>

    • Parameters

      • guildId: string

        The guild ID.

      • query: RESTGetAPIGuildBansQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIGuildBansResult>

    • Parameters

      • guildId: string

        The guild ID.

      • query: RESTGetAPIGuildPruneCountQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIGuildPruneCountResult>

    • Parameters

      • guildId: string

        The guild ID.

      • eventId: string

        The event ID.

      • query: RESTGetAPIGuildScheduledEventQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildScheduledEvent>

    • Parameters

      • guildId: string

        The guild ID.

      • eventId: string

        The event ID.

      • query: RESTGetAPIGuildScheduledEventUsersQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIGuildScheduledEventUsersResult>

    • Parameters

      • applicationId: string

        The application ID.

      • interactionToken: string

        The interaction token.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • emoji: string

        The emoji's identifier.

      • query: RESTGetAPIChannelMessageReactionUsersQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIChannelMessageReactionUsersResult>

    • Parameters

      • webhookId: string

        The webhook ID.

      • token: string

        The webhook's token.

      • messageId: string

        The message ID.

      • OptionalthreadId: string

        The thread ID.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIMessage>

    • Parameters

      • webhookId: string

        The webhook ID.

      • token: string

        The webhook's token.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIWebhookWithTokenResult>

    • Parameters

      • channelId: string

        The channel ID.

      • userId: string

        The user ID.

      • body: RESTPutAPIChannelRecipientJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<unknown>

    • Parameters

      • guildId: string

        The guild ID.

      • query: RESTGetAPIGuildMembersQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIGuildMembersResult>

    • Parameters

      • channelId: string

        The channel ID.

      • query: RESTGetAPIChannelThreadsArchivedQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIChannelUsersThreadsArchivedResult>

    • Parameters

      • channelId: string

        The channel ID.

      • query: RESTGetAPIChannelThreadsArchivedQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIChannelUsersThreadsArchivedResult>

    • Parameters

      • channelId: string

        The channel ID.

      • query: RESTGetAPIChannelThreadsArchivedQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIChannelUsersThreadsArchivedResult>

    • Parameters

      • guildId: string

        The guild ID.

      • query: RESTGetAPIGuildScheduledEventsQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIGuildScheduledEventsResult>

    • Parameters

      • guildId: string

        The guild ID.

      • autoModerationRuleId: string

        The auto moderation rule ID.

      • body: DiscordTypes.RESTPatchAPIAutoModerationRuleJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIAutoModerationRule>

    • Parameters

      • channelId: string

        The channel ID.

      • body: RESTPatchAPIChannelJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIChannel>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPatchAPICurrentGuildMemberJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildMember>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPatchAPIGuildJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuild>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPatchAPIGuildChannelPositionsJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPatchAPIGuildEmojiJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIEmoji>

    • Parameters

      • guildId: string

        The guild ID.

      • userId: string

        The user ID.

      • body: RESTPatchAPIGuildMemberJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildMember>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPostAPIGuildsMFAJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTPostAPIGuildsMFAJSONBody>

    • Parameters

      • guildId: string

        The guild ID.

      • roleId: string

        The role ID.

      • body: RESTPatchAPIGuildRoleJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIRole>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPatchAPIGuildRolePositionsJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTPatchAPIGuildRolePositionsResult>

    • Parameters

      • guildId: string

        The guild ID.

      • eventId: string

        The event ID.

      • body: RESTPatchAPIGuildScheduledEventJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildScheduledEvent>

    • Parameters

      • guildId: string

        The guild ID.

      • stickerId: string

        The sticker ID.

      • body: RESTPatchAPIGuildStickerJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APISticker>

    • Parameters

      • guildId: string

        The guild ID.

      • body: RESTPatchAPIGuildWelcomeScreenJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildWelcomeScreen>

    • Parameters

      • guildId: string

        The guild ID.

      • body: DiscordTypes.RESTPatchAPIGuildWidgetSettingsJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIGuildWidgetSettings>

    • Parameters

      • channelId: string

        The channel ID.

      • body: RESTPatchAPIStageInstanceJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIStageInstance>

    • Parameters

      • guildId: string

        The guild ID.

      • userId: string

        The user ID.

      • body: RESTPatchAPIGuildVoiceStateUserJSONBody

        Request body.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • webhookId: string

        The webhook ID.

      • body: RESTPatchAPIWebhookJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIWebhook>

    • Parameters

      • webhookId: string

        The webhook ID.

      • token: string

        The webhook's token.

      • body: DiscordTypes.RESTPatchAPIWebhookWithTokenJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIWebhookWithTokenResult>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • userId: string

        The user ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • userId: string

        The user ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Parameters

      • guildId: string

        The guild ID.

      • userId: string

        The user ID.

      • roleId: string

        The role ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>

    • Make a rest request.

      Parameters

      • method: RestMethod

        The request's method.

      • route: `/${string}`

        The requests's route, relative to the base Discord API URL. (Example: /channels/123456789000000000)

      • options: RestRequestData = {}

        Request options.

      Returns Promise<any>

      Response body.

    • Parameters

      • guildId: string

        The guild ID.

      • query: RESTGetAPIGuildMembersSearchQuery

        Request query.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<RESTGetAPIGuildMembersSearchResult>

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • body: RESTPostAPIChannelMessagesThreadsJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIChannel>

    • Parameters

      • channelId: string

        The channel ID.

      • body: FormData | RESTPostAPIGuildForumThreadsJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIChannel>

      PR in discord-api-types for proper return type.

    • Parameters

      • channelId: string

        The channel ID.

      • body: RESTPostAPIChannelThreadsJSONBody

        Request body.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<APIChannel>

    • Cleans up inactive buckets without active local rate limits. Useful for manually preventing potentially fatal memory leaks in large bots.

      Returns void

    • Parameters

      • channelId: string

        The channel ID.

      • messageId: string

        The message ID.

      • Optionalreason: string

        The value for the X-Audit-Log-Reason header.

      • Optionaloptions: RestRequestOptions

        Request options.

      Returns Promise<never>