Reference
Classes
Clusterclient

Class: ClusterClient

Represents a socket based Client.

Extends

Constructors

new ClusterClient()

new ClusterClient(token, options, workerId): ClusterClient

Parameters

ParameterTypeDescription
tokenstring-
optionsPartial<ClientOptions>Client options to customize every thing, such as API version, URLs, sharding, etc...
workerIdnumber-

Returns

ClusterClient

Overrides

Client.constructor

Defined in

src/core/cluster/ClusterClient.ts:8 (opens in a new tab)

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
#tokenprotectedstringThe Discord authorization token.Client.#tokensrc/core/Client.ts:36 (opens in a new tab)
cachepublicClientCacheManagerClient cache utility will store Guild objects when received from Discord gateway and API,Client.cachesrc/core/Client.ts:61 (opens in a new tab)
eventspublicClientEventsAll events received from Discord gateway and other utility events.Client.eventssrc/core/Client.ts:71 (opens in a new tab)
ipcpublicIPC--src/core/cluster/ClusterClient.ts:5 (opens in a new tab)
optionspublicClientOptionsClient options to customize every thing, such as API version, URLs, sharding, etc...Client.optionssrc/core/Client.ts:56 (opens in a new tab)
readypublicbooleanWhether has completed the initialization setup and is fully connected to Discord gateway.Client.readysrc/core/Client.ts:51 (opens in a new tab)
restpublicRequestManagerUtility class to handle all HTTPS requests to Discord API.Client.restsrc/core/Client.ts:41 (opens in a new tab)
shardspublicGatewayManagerGateway manager, handle all shards connection.Client.shardssrc/core/Client.ts:46 (opens in a new tab)
user?publicUserThe client user.Client.usersrc/core/Client.ts:66 (opens in a new tab)
workerIdpublicnumber--src/core/cluster/ClusterClient.ts:6 (opens in a new tab)

Methods

getMe()

getMe(): Promise<User>

Get and set the client user object.

await client.getMe();
console.log(client.user);
const user = await client.getMe();
console.log(user);

Returns

Promise<User>

Inherited from

Client.getMe

Defined in

src/core/Client.ts:124 (opens in a new tab)


init()

init(): Promise<void>

Start the initialization process, first it will try to catch the user itself, then it will connect all the shards.

await client.init();

Returns

Promise<void>

Inherited from

Client.init

Defined in

src/core/Client.ts:142 (opens in a new tab)