interface RESTOptionsOptions to be passed when creating the REST instance
externalagent : Dispatcher | null
The agent to set globally
externalapi : string = 'https://discord.com/api'
The base api path, without version
The authorization prefix to use for requests, useful if you want to use bearer tokens
externalcdn : string = 'https://cdn.discordapp.com'
The cdn path
externalglobalRequestsPerSecond : number = 50
How many requests to allow sending per second (Infinity for unlimited, 50 for the standard global limit used by Discord)
externalhandlerSweepInterval : number = 3_600_000
The amount of time in milliseconds that passes between each hash sweep. (defaults to 1h)
externalhashLifetime : number = 86_400_000
The maximum amount of time a hash can exist in milliseconds without being hit with a request (defaults to 24h)
externalhashSweepInterval : number = 14_400_000
The amount of time in milliseconds that passes between each hash sweep. (defaults to 4h)
externalinvalidRequestWarningInterval : number = 0
The number of invalid REST requests (those that return 401, 403, or 429) in a 10 minute window between emitted warnings (0 for no warnings). That is, if set to 500, warnings will be emitted at invalid request number 500, 1000, 1500, and so on.
externalmediaProxy : string = 'https://media.discordapp.net'
The media proxy path
externaloffset : GetRateLimitOffsetFunction | number = 50
The extra offset to add to rate limits in milliseconds
externalrejectOnRateLimit : RateLimitQueueFilter | string[] | null = null
Determines how rate limiting and pre-emptive throttling should be handled. When an array of strings, each element is treated as a prefix for the request route (e.g. /channels to match any route starting with /channels such as /channels/:id/messages) for which to throw RateLimitErrors. All other request routes will be queued normally
externalretries : number = 3
The number of retries for errors with the 500 code, or errors that timeout
externalretryBackoff : GetRetryBackoffFunction | number = 0
The time to exponentially add before retrying a 5xx or aborted request
externaltimeout : GetTimeoutFunction | number = 15_000
The time to wait in milliseconds before a request is aborted
externaluserAgentAppendix : string = DefaultUserAgentAppendix
Extra information to add to the user agent
externalversion : string = '10'
The version of the API to use
external makeRequest(url: stringinit: RequestInit) : Promise<ResponseLike>
The method called to perform the actual HTTP request given a url and web fetch options For example, to use global fetch, simply provide makeRequest: fetch