Skip to main content

Class: RequestHandler

Represents the class that manages handlers for endpoints.

Hierarchy

  • EventEmitter

    RequestHandler

Constructors

constructor

new RequestHandler(options?)

Parameters

NameType
options?RequestHandlerOptions

Defined in

rest/RequestHandler.ts:74

Properties

emit

emit: <K>(event: K, ...args: IRestEvents[K]) => boolean & <S>(event: Exclude<S, keyof IRestEvents>, ...args: any[]) => boolean

Defined in

rest/RequestHandler.ts:14


off

off: <K>(event: K, listener: (...args: IRestEvents[K]) => void) => RequestHandler & <S>(event: Exclude<S, keyof IRestEvents>, listener: (...args: any[]) => void) => RequestHandler

Defined in

rest/RequestHandler.ts:17


on

on: <K>(event: K, listener: (...args: IRestEvents[K]) => void) => RequestHandler & <S>(event: Exclude<S, keyof IRestEvents>, listener: (...args: any[]) => void) => RequestHandler

Defined in

rest/RequestHandler.ts:20


once

once: <K>(event: K, listener: (...args: IRestEvents[K]) => void) => RequestHandler & <S>(event: Exclude<S, keyof IRestEvents>, listener: (...args: any[]) => void) => RequestHandler

Defined in

rest/RequestHandler.ts:23


removeAllListeners

removeAllListeners: <K>(event?: K) => RequestHandler & <S>(event?: Exclude<S, keyof IRestEvents>) => RequestHandler

Defined in

rest/RequestHandler.ts:26

Methods

setKeys

setKeys(keys): RequestHandler

Parameters

NameType
keysstring[]

Returns

RequestHandler

Defined in

rest/RequestHandler.ts:103


request

request<T>(path, options?): Promise<Result<T>>

Type parameters

Name
T

Parameters

NameType
pathstring
optionsRequestOptions

Returns

Promise<Result<T>>

Defined in

rest/RequestHandler.ts:112


rawRequest

rawRequest<T>(path, options?): Promise<T>

Type parameters

Name
T

Parameters

NameType
pathstring
optionsRequestOptions

Returns

Promise<T>

Defined in

rest/RequestHandler.ts:128


init

init(options): Promise<string[]>

Parameters

NameType
optionsLoginOptions

Returns

Promise<string[]>

Defined in

rest/RequestHandler.ts:202

Events

debug

debug: string

Emitted for general debugging information.

Defined in

rest/RequestHandler.ts:34


error

error: string

Emitted when the client encounters an error.

Defined in

rest/RequestHandler.ts:41


rateLimited

rateLimited: string

Emitted when the client is rate limited.

Defined in

rest/RequestHandler.ts:48