Class: RequestManager
Represents a RequestManager.
Constructors
new RequestManager()
new RequestManager(
client,token):RequestManager
Parameters
| Parameter | Type |
|---|---|
client | Client |
token | string |
Returns
Defined in
src/core/rest/RequestManager.ts:116 (opens in a new tab)
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
#client | protected | Client | The client instance. | src/core/rest/RequestManager.ts:114 (opens in a new tab) |
#token | protected | string | The 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
| Parameter | Type |
|---|---|
options | RequestOptions |
Returns
Promise<RequestReponse>