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