Create a rest manager.
The bot's token.
A callback to be used for logging events internally in the rest manager.
Optional
logThisArg: anyA value to use as this
in the logCallback
.
The interval used for sweeping inactive buckets.
The amount of requests left in the global rate limit bucket.
A unix millisecond timestamp at which the global rate limit resets.
Readonly
optionsOptions for the rest manager.
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.
Cached route rate limit bucket hashes. Keys are cached route hashes, with their values being their corresponding RestBucketHash bucket hash.
Readonly
systemThe system string used for logging.
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.
The guild ID.
The user ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
The role ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The thread ID.
The user ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The application ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
Request body.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The interaction token.
Request body.
Optional
options: RestRequestOptionsRequest options.
The application ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
Request body.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The interaction ID.
The interaction token.
Request body.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
The emoji's identifier.
Optional
options: RestRequestOptionsRequest options.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
The emoji's identifier.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The auto moderation rule ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The overwrite's ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The interaction token.
The message ID.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The command ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
The command ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The emoji's identifier.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The integration ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The role ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The event ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The sticker ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The invite code.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The interaction token.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
The emoji's identifier.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
The emoji's identifier.
The user ID.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
The webhook's token.
The message ID.
Optional
threadId: stringThe thread ID.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
The command ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The overwrite ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The interaction token.
The message ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The command ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
The command ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The interaction token.
Request body.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
The webhook's token.
The message ID.
Optional
threadId: stringThe thread ID.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
The webhook's token.
Request body.
Optional
wait: TIf the response should wait until server confirmation.
Optional
threadId: stringThe thread ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
The command ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The auto moderation rule ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Optional
options: RestRequestOptionsRequest options.
Optional
options: RestRequestOptionsRequest options.
Optional
options: RestRequestOptionsRequest options.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
Request query.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The interaction token.
The message ID.
Optional
options: RestRequestOptionsRequest options.
Optional
options: RestRequestOptionsRequest options.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The command ID.
Optional
options: RestRequestOptionsRequest options.
The application ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
The command ID.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The guild ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The emoji's identifier.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The event ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The event ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The sticker ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The invite code.
Request query.
Optional
options: RestRequestOptionsRequest options.
The application ID.
The interaction token.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
The emoji's identifier.
Request query.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Optional
options: RestRequestOptionsRequest options.
The sticker ID.
Optional
options: RestRequestOptionsRequest options.
The user ID.
Optional
options: RestRequestOptionsRequest options.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
The webhook's token.
The message ID.
Optional
threadId: stringThe thread ID.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
The webhook's token.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The user ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The user ID.
Optional
options: RestRequestOptionsRequest options.
The thread ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The thread ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The thread ID.
Optional
options: RestRequestOptionsRequest options.
Optional
options: RestRequestOptionsRequest options.
Internal
The internal rest make method.
Used by rest buckets, and the Rest#request()
method if rate limits are turned off.
Only use this method if you know exactly what you are doing.
The request's method.
The requests's route, relative to the base Discord API URL. (Example: /channels/123456789000000000
)
Request options.
The full undici response.
The guild ID.
The auto moderation rule ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
Request body.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The role ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The event ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The sticker ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
Request body.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The webhook ID.
The webhook's token.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The guild ID.
The user ID.
The role ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The thread ID.
The user ID.
Optional
options: RestRequestOptionsRequest options.
Make a rest request.
The request's method.
The requests's route, relative to the base Discord API URL. (Example: /channels/123456789000000000
)
Request options.
Response body.
The guild ID.
Request query.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
Request body.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
Cleans up inactive buckets without active local rate limits. Useful for manually preventing potentially fatal memory leaks in large bots.
The channel ID.
Optional
options: RestRequestOptionsRequest options.
The channel ID.
The message ID.
Optional
reason: stringThe value for the X-Audit-Log-Reason
header.
Optional
options: RestRequestOptionsRequest options.
Generated using TypeDoc
The rest manager. Used for making rest requests to the Discord API.