class REST

extends

EventEmitter
export declare class REST extends EventEmitter

Constructors

constructor(
options?: Partial<RESTOptions>
)

Constructs a new instance of the REST class

readonly
cdn : CDN

readonly
requestManager : RequestManager

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: REST

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: REST

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: REST

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: REST

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

Inherited from: REST

delete(
fullRoute: RouteLike
options?: RequestData
) : Promise<unknown>

Runs a delete request from the api

get(
fullRoute: RouteLike
options?: RequestData
) : Promise<unknown>

Runs a get request from the api

getAgent() : Dispatcher | null

Gets the agent set for this instance

patch(
fullRoute: RouteLike
options?: RequestData
) : Promise<unknown>

Runs a patch request from the api

post(
fullRoute: RouteLike
options?: RequestData
) : Promise<unknown>

Runs a post request from the api

put(
fullRoute: RouteLike
options?: RequestData
) : Promise<unknown>

Runs a put request from the api

Runs a request from the API, yielding the raw Response object

request() : Promise<unknown>

Runs a request from the api

setAgent(
agent: Dispatcher
) : this

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

setToken(
token: string
) : this

Sets the authorization token that should be used for requests