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

_timeout: Timeout

This is an interval to constantly check Buckets which should be reset or unreferenced from the RateLimiter to be swept by the garbage collector. This 1 timeout is more performant as compared to potentially many more ticking timers to reset individual bucket remaining values.

YOU SHOULD NEVER OVERRIDE THIS UNLESS YOU KNOW WHAT YOU'RE DOING. REQUESTS MAY POSSIBLY NEVER EXECUTE WITHOUT THIS AND/OR MEMORY MAY SLOWLY CLIMB OVER TIME.

_timeoutDuration: number
_timeoutFN: (() => void)

Type declaration

    • (): void
    • Returns void

buckets: {}

Type declaration

global: boolean
globalResetAt: number

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