RESTManager
Defined in: classes/rest-manager.ts:6
Class representing a manager for handling REST API calls
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RESTManager(
props):RESTManager
Defined in: classes/rest-manager.ts:19
Instantiate a new RESTManager
Parameters
Section titled “Parameters”RESTManager props
Returns
Section titled “Returns”RESTManager
RESTManager instance
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get token():
string
Defined in: classes/rest-manager.ts:10
Bot token used for authorization
Returns
Section titled “Returns”string
Methods
Section titled “Methods”delete()
Section titled “delete()”delete<
T>(endpoint):Promise<Response&object>
Defined in: classes/rest-manager.ts:62
Send a DELETE request
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Endpoint URI
Returns
Section titled “Returns”Promise<Response & object>
Response extended with data property
get<
T>(endpoint):Promise<Response&object>
Defined in: classes/rest-manager.ts:71
Send a GET request
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Endpoint URI
Returns
Section titled “Returns”Promise<Response & object>
Response extended with data property
patch()
Section titled “patch()”patch<
T>(endpoint,options?):Promise<Response&object>
Defined in: classes/rest-manager.ts:81
Send a PATCH request
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Endpoint URI
options?
Section titled “options?”Request options
any
Returns
Section titled “Returns”Promise<Response & object>
Response extended with data property
post()
Section titled “post()”post<
T>(endpoint,options?):Promise<Response&object>
Defined in: classes/rest-manager.ts:91
Send a POST request
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Endpoint URI
options?
Section titled “options?”Request options
any
Returns
Section titled “Returns”Promise<Response & object>
Response extended with data property
put<
T>(endpoint,options?):Promise<Response&object>
Defined in: classes/rest-manager.ts:101
Send a PUT request
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”string
Endpoint URI
options?
Section titled “options?”Request options
any
Returns
Section titled “Returns”Promise<Response & object>
Response extended with data property
request()
Section titled “request()”request<
T>(method,endpoint,options?):Promise<Response&object>
Defined in: classes/rest-manager.ts:39
Send a request to the API
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”method
Section titled “method”HTTP method (GET, POST, PATCH, PUT, DELETE)
endpoint
Section titled “endpoint”string
Endpoint URI
options?
Section titled “options?”Request options
any
Returns
Section titled “Returns”Promise<Response & object>
Response extended with data property