Class RateLimitError

Data emitted on RESTEvents.RateLimited

Hierarchy

  • Error
    • RateLimitError

Implements

Constructors

  • Parameters

    Returns RateLimitError

Properties

cause?: unknown
global: boolean

Whether the rate limit that was reached was the global limit

hash: string

The bucket hash for this request

limit: number

The amount of requests we can perform before locking requests

majorParameter: string

The major parameter of the route

For example, in /channels/x, this will be x. If there is no major parameter (e.g: /bot/gateway) this will be global.

message: string
method: string

The HTTP method being performed

retryAfter: number

The time, in milliseconds, that will need to pass before this specific request can be retried

route: string

The route being hit in this request

scope: "user" | "global" | "shared"

The scope of the rate limit that was hit.

This can be user for rate limits that are per client, global for rate limits that affect all clients or shared for rate limits that are shared per resource.

stack?: string
sublimitTimeout: number

The time, in milliseconds, that will need to pass before the sublimit lock for the route resets, and requests that fall under a sublimit can be retried

This is only present on certain sublimits, and 0 otherwise

timeToReset: number

The time, in milliseconds, until the route's request-lock is reset

url: string

The full URL for this request

prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Accessors

  • get name(): string
  • The name of the error

    Returns string

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc