Skip to content

BaseClient

classe · Source

The base class for all clients.

Extends: EventEmitter

Properties

options

options: ClientOptions

The options the client was instantiated with Source

rest

private

rest: RESTManager

The REST manager of the client Source

api

readonly · private

api: Object

API shortcut Source

Methods

destroy

destroy(): void

Destroys all assets used by the base client. Returns: voidSource

incrementMaxListeners

private

incrementMaxListeners()

Increments max listeners by one, if they are not zero. Source

decrementMaxListeners

private

decrementMaxListeners()

Decrements max listeners by one, if they are not zero. Source

Events

debug

debug: unknown

Emitted for general debugging information. Parameters

NameTypeDescription
infostringThe debug information
Source

rateLimit

rateLimit: unknown

Emitted when the client hits a rate limit while making a request Parameters

NameTypeDescription
rateLimitDataRateLimitDataObject containing the rate limit info
Source

apiRequest

apiRequest: unknown

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

NameTypeDescription
requestAPIRequestThe request that is about to be sent
Source

apiResponse

apiResponse: unknown

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

NameTypeDescription
requestAPIRequestThe request that triggered this response
responseResponseThe response received from the Discord API
Source

invalidRequestWarning

invalidRequestWarning: unknown

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

NameTypeDescription
invalidRequestWarningDataInvalidRequestWarningDataObject containing the invalid request info
Source

Unofficial software. Not affiliated with or supported by Discord.