class RequestManager

extends

EventEmitter
declare class RequestManager extends EventEmitter

Represents the class that manages handlers for endpoints

Constructors

constructor()

Constructs a new instance of the RequestManager class

agent : Dispatcher | null

The for all requests performed by this manager.

globalDelay : Promise<void> | null

The promise used to wait out the global rate limit

globalRemaining : number

The number of requests remaining in the global bucket

globalReset : number

The timestamp at which the global bucket resets

readonly
handlers : Collection<string, IHandler>

Request handlers created from the bucket hash and the major parameters

readonly
hashes : Collection<string, HashData>

API bucket hashes that are cached from provided routes

readonly
options : RESTOptions

emit : (<K extends keyof RestEvents>(event: K, ...args: RestEvents[K]) => boolean) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, ...args: any[]) => boolean)

Inherited from: RequestManager

off : (<K extends keyof RestEvents>(event: K, listener: (...args: RestEvents[K]) => void) => this) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, listener: (...args: any[]) => void) => this)

Inherited from: RequestManager

on : (<K extends keyof RestEvents>(event: K, listener: (...args: RestEvents[K]) => void) => this) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, listener: (...args: any[]) => void) => this)

Inherited from: RequestManager

once : (<K extends keyof RestEvents>(event: K, listener: (...args: RestEvents[K]) => void) => this) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, listener: (...args: any[]) => void) => this)

Inherited from: RequestManager

removeAllListeners : (<K extends keyof RestEvents>(event?: K) => this) & (<S extends string | symbol>(event?: Exclude<S, keyof RestEvents>) => this)

Inherited from: RequestManager

clearHandlerSweeper() : void

Stops the request handler sweeping interval

clearHashSweeper() : void

Stops the hash sweeping interval

Queues a request to be sent

Returns: The response from the api request

setAgent(
agent: Dispatcher
) : this

Sets the default agent to use for requests performed by this manager

setToken(
token: string
) : this

Sets the authorization token that should be used for requests