InvalidRequestBucket
Documentation / @discordeno/bot / InvalidRequestBucket
Interface: InvalidRequestBucket
Defined in: packages/rest/dist/types/invalidBucket.d.ts:28
Properties
activeRequests
activeRequests:
number
Defined in: packages/rest/dist/types/invalidBucket.d.ts:42
The amount of requests that were requested from this bucket.
errorStatuses
errorStatuses:
number
[]
Defined in: packages/rest/dist/types/invalidBucket.d.ts:40
The request statuses that count as an invalid request.
handleCompletedRequest()
handleCompletedRequest: (
code
,sharedScope
) =>void
Defined in: packages/rest/dist/types/invalidBucket.d.ts:58
Handler for whenever a request is validated. This should update the requested values or trigger any other necessary stuff.
Parameters
code
number
sharedScope
boolean
Returns
void
interval
interval:
number
Defined in: packages/rest/dist/types/invalidBucket.d.ts:34
The time that discord allows to make the max number of invalid requests. Defaults to 10 minutes
invalidRequests
invalidRequests:
number
Defined in: packages/rest/dist/types/invalidBucket.d.ts:30
current invalid amount
isRequestAllowed()
isRequestAllowed: () =>
boolean
Defined in: packages/rest/dist/types/invalidBucket.d.ts:52
Checks if a request is allowed at this time.
Returns
boolean
logger
logger:
Pick
<{debug
: (...args
) =>void
;error
: (...args
) =>void
;fatal
: (...args
) =>void
;info
: (...args
) =>void
;log
: (level
, ...args
) =>void
;setDepth
: (level
) =>void
;setLevel
: (level
) =>void
;warn
: (...args
) =>void
; },"debug"
|"info"
|"warn"
|"error"
|"fatal"
>
Defined in: packages/rest/dist/types/invalidBucket.d.ts:48
The logger that will be used for the bucket
max
max:
number
Defined in: packages/rest/dist/types/invalidBucket.d.ts:32
max invalid requests allowed until ban. Defaults to 10,000
processing
processing:
boolean
Defined in: packages/rest/dist/types/invalidBucket.d.ts:46
Whether or not the waiting queue is already processing.
processWaiting()
processWaiting: () =>
Promise
<void
>
Defined in: packages/rest/dist/types/invalidBucket.d.ts:56
Begins processing the waiting queue of requests.
Returns
Promise
<void
>
requestsAllowed()
requestsAllowed: () =>
number
Defined in: packages/rest/dist/types/invalidBucket.d.ts:50
Gives the number of requests that are currently allowed.
Returns
number
resetAt
resetAt:
undefined
|number
Defined in: packages/rest/dist/types/invalidBucket.d.ts:36
When the timeout for this bucket has started at.
safety
safety:
number
Defined in: packages/rest/dist/types/invalidBucket.d.ts:38
how safe to be from max. Defaults to 1
waiting
waiting: (
value
) =>void
[]
Defined in: packages/rest/dist/types/invalidBucket.d.ts:44
The requests that are currently pending.
Parameters
value
void
| PromiseLike
<void
>
Returns
void
waitUntilRequestAvailable()
waitUntilRequestAvailable: () =>
Promise
<void
>
Defined in: packages/rest/dist/types/invalidBucket.d.ts:54
Waits until a request is available
Returns
Promise
<void
>