Class RestBucketInternal

A rest bucket. Used for rate limiting requests.

Hierarchy

  • RestBucket

Constructors

  • Create a rest bucket.

    Parameters

    • id: `${string}(${string})`

      The bucket's ID.

    • bucketHash: string

      The bucket's unique RestBucketHash hash.

    • majorParameter: string

      The RestMajorParameter major parameter associated with the bucket.

    • manager: Rest

      The rest manager the bucket is bound to.

    Returns RestBucket

Properties

allowedRequestsPerRatelimit: number = Infinity

The number of allowed requests per a rate limit interval.

bucketHash: string

The bucket's unique RestBucketHash hash.

id: `${string}(${string})`

The bucket's ID.

majorParameter: string

The RestMajorParameter major parameter associated with the bucket.

manager: Rest

The rest manager the bucket is bound to.

requestsLeft: number = 1

The current number of requests left.

resetAt: number = -1

A unix millisecond timestamp at which the rate limit resets.

system: "Rest Bucket" = ...

The system string used for logging.

Accessors

  • get ratelimited(): {
        any: boolean;
        global: boolean;
        local: boolean;
    }
  • Get information on the bucket's current rate limit restrictions.

    Returns {
        any: boolean;
        global: boolean;
        local: boolean;
    }

    • any: boolean
    • global: boolean
    • local: boolean

Methods

  • Make a rest request with this bucket's rate limits.

    Parameters

    • method: RestMethod

      The request's method.

    • route: `/${string}`

      The requests's route, relative to the base Discord API URL. (Example: /channels/123456789000000000)

    • routeHash: `GET;${string}` | `POST;${string}` | `DELETE;${string}` | `PATCH;${string}` | `PUT;${string}`

      The request's route hash.

    • options: RestRequestData

      Request options.

    Returns Promise<any>

    Response data.

Generated using TypeDoc