declare class RequestManager extends EventEmitter
Represents the class that manages handlers for endpoints
Constructors
options: Partial<RESTOptions>)
constructor(Constructs a new instance of the RequestManager
class
Dispatcher | null agent :
The for all requests performed by this manager.
Promise<void> | null globalDelay :
The promise used to wait out the global rate limit
number globalRemaining :
The number of requests remaining in the global bucket
number globalReset :
The timestamp at which the global bucket resets
readonlyCollection<string, IHandler> handlers :
Request handlers created from the bucket hash and the major parameters
readonlyCollection<string, HashData> hashes :
API bucket hashes that are cached from provided routes
readonlyRESTOptions options :
(<K extends keyof RestEvents>(event: K, ...args: RestEvents[K]) => boolean) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, ...args: any[]) => boolean) emit :
Inherited from: RequestManager
(<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) off :
Inherited from: RequestManager
(<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) on :
Inherited from: RequestManager
(<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) once :
Inherited from: RequestManager
(<K extends keyof RestEvents>(event?: K) => this) & (<S extends string | symbol>(event?: Exclude<S, keyof RestEvents>) => this) removeAllListeners :
Inherited from: RequestManager
clearHandlerSweepervoid () :
Stops the request handler sweeping interval
clearHashSweepervoid () :
Stops the hash sweeping interval
queueRequestrequest: InternalRequest) : Promise<Dispatcher.ResponseData> (
Queues a request to be sent
Returns: The response from the api request
setAgentagent: Dispatcher) : this (
Sets the default agent to use for requests performed by this manager
setTokentoken: string) : this (
Sets the authorization token that should be used for requests