Reference
Classes
Requestmanager

Class: RequestManager

Represents a RequestManager.

Constructors

new RequestManager()

new RequestManager(client, token): RequestManager

Parameters

ParameterType
clientClient
tokenstring

Returns

RequestManager

Defined in

src/core/rest/RequestManager.ts:116 (opens in a new tab)

Properties

PropertyModifierTypeDescriptionDefined in
#clientprotectedClientThe client instance.src/core/rest/RequestManager.ts:114 (opens in a new tab)
#tokenprotectedstringThe Discord authorization token.src/core/rest/RequestManager.ts:107 (opens in a new tab)

Methods

request()

request(options): Promise<RequestReponse>

The method used to send a request to Discord API.

const user = await client.rest.request({
 method: 'GET',
 endpoint: '/users/@me',
 auth: true
});
 
// Raw user object from API
console.log(user.data);

Parameters

ParameterType
optionsRequestOptions

Returns

Promise<RequestReponse>

Defined in

src/core/rest/RequestManager.ts:142 (opens in a new tab)