Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Ratelimiter Protected

Ratelimiter used for handling the ratelimits imposed by the rest api

Hierarchy

  • Ratelimiter

Index

Constructors

Properties

_global: any

If you're being globally rate limited

buckets: {}

An object of Buckets that store rate limit info

Type declaration

globalReset: number

Timeframe in milliseconds until when the global rate limit resets

globalResetTimeout: null | Timeout

Timeout that resets the global ratelimit once the timeframe has passed

default: typeof <internal>.Ratelimiter

Accessors

  • get global(): boolean
  • set global(value: boolean): void
  • If you're being globally rate limited

    Returns boolean

  • If you're being globally rate limited

    Parameters

    • value: boolean

    Returns void

Methods

  • Queue a rest call to be executed

    Parameters

    Returns void

  • routify(url: string, method: string): string
  • Returns a key for saving ratelimits for routes (Taken from https://github.com/abalabahaha/eris/blob/master/lib/rest/RequestHandler.js) -> I luv u abal <3

    Parameters

    • url: string

      url to reduce to a key something like /channels/266277541646434305/messages/266277541646434305/

    • method: string

      method of the request, usual http methods like get, etc.

    Returns string

    reduced url: /channels/266277541646434305/messages/:id/

Generated using TypeDoc