Skip to main content

SendRequestOptions

Documentation


Documentation / @discordeno/rest / SendRequestOptions

Interface: SendRequestOptions

Defined in: types.ts:242

Properties​

bucketId?​

optional bucketId?: string

Defined in: types.ts:256

If this request has a bucket id which it falls under for rate limit


method​

method: RequestMethods

Defined in: types.ts:246

The method to use for sending the request.


reject​

reject: (value) => void

Defined in: types.ts:254

Reject handler when a request fails.

Parameters​

value​

RestRequestRejection

Returns​

void


requestBodyOptions?​

optional requestBodyOptions?: CreateRequestBodyOptions

Defined in: types.ts:266

Additional request options, used for things like overriding authorization header.


resolve​

resolve: (value) => void

Defined in: types.ts:252

Resolve handler when a request succeeds.

Parameters​

value​

RestRequestResponse

Returns​

void


retryCount​

retryCount: number

Defined in: types.ts:248

The amount of times this request has been retried.


retryRequest?​

optional retryRequest?: (options) => Promise<void>

Defined in: types.ts:250

Handler to retry a request should it be rate limited.

Parameters​

options​

SendRequestOptions

Returns​

Promise<void>


route​

route: string

Defined in: types.ts:244

The route to send the request to.


runThroughQueue?​

optional runThroughQueue?: boolean

Defined in: types.ts:271

Whether the request should be run through the queue. Useful for routes which do not have any rate limits.


simplifiedUrl?​

optional simplifiedUrl?: string

Defined in: types.ts:264

The simplified url of this request, as rest.simplifyUrl returned it when the request was first handled.

Remarks​

The simplified url of a message delete depends on how old the message is, so it has to be kept instead of being worked out again later, or the key the queue was found under and the key its response is credited to stop matching once the message crosses one of those ages.