BaseClient
classe · Source
The base class for all clients.
Extends: EventEmitter
Properties
options
The options the client was instantiated with Source
rest
The REST manager of the client Source
api
API shortcut Source
Methods
destroy
Destroys all assets used by the base client. Returns: voidSource
incrementMaxListeners
Increments max listeners by one, if they are not zero. Source
decrementMaxListeners
Decrements max listeners by one, if they are not zero. Source
Events
debug
Emitted for general debugging information. Parameters
| Name | Type | Description |
|---|---|---|
info | string | The debug information |
| Source |
rateLimit
Emitted when the client hits a rate limit while making a request Parameters
| Name | Type | Description |
|---|---|---|
rateLimitData | RateLimitData | Object containing the rate limit info |
| Source |
apiRequest
Emitted before every API request. This event can emit several times for the same request, e.g. when hitting a rate limit. This is an informational event that is emitted quite frequently, it is highly recommended to check request.path to filter the data. Parameters
| Name | Type | Description |
|---|---|---|
request | APIRequest | The request that is about to be sent |
| Source |
apiResponse
Emitted after every API request has received a response. This event does not necessarily correlate to completion of the request, e.g. when hitting a rate limit. This is an informational event that is emitted quite frequently, it is highly recommended to check request.path to filter the data. Parameters
| Name | Type | Description |
|---|---|---|
request | APIRequest | The request that triggered this response |
response | Response | The response received from the Discord API |
| Source |
invalidRequestWarning
Emitted periodically when the process sends invalid requests to let users avoid the 10k invalid requests in 10 minutes threshold that causes a ban Parameters
| Name | Type | Description |
|---|---|---|
invalidRequestWarningData | InvalidRequestWarningData | Object containing the invalid request info |
| Source |