RequestClient
This is the main class that handles making requests to the Discord API. It is used internally by Carbon, and you should not need to use it directly, but feel free to if you feel like living dangerously.
Constructors
Constructor
new RequestClient(
token
,options?
):RequestClient
Parameters
Parameter | Type |
---|---|
token | string |
options? | RequestClientOptions |
Returns
RequestClient
Properties
Property | Modifier | Type | Default value | Description |
---|---|---|---|---|
options | readonly | RequestClientOptions | undefined | The options used to initialize the client |
queue | protected | QueuedRequest [] | [] | - |
Methods
abortAllRequests()
abortAllRequests():
void
Returns
void
delete()
delete(
path
,data?
):Promise
<unknown
>
Parameters
Parameter | Type |
---|---|
path | string |
data? | RequestData |
Returns
Promise
<unknown
>
get()
get(
path
):Promise
<unknown
>
Parameters
Parameter | Type |
---|---|
path | string |
Returns
Promise
<unknown
>
patch()
patch(
path
,data?
):Promise
<unknown
>
Parameters
Parameter | Type |
---|---|
path | string |
data? | RequestData |
Returns
Promise
<unknown
>
post()
post(
path
,data?
):Promise
<unknown
>
Parameters
Parameter | Type |
---|---|
path | string |
data? | RequestData |
Returns
Promise
<unknown
>
put()
put(
path
,data?
):Promise
<unknown
>
Parameters
Parameter | Type |
---|---|
path | string |
data? | RequestData |
Returns
Promise
<unknown
>