Class: ClusterClient
Represents a socket based Client.
Extends
Constructors
new ClusterClient()
new ClusterClient(
token,options,workerId):ClusterClient
Parameters
| Parameter | Type | Description |
|---|---|---|
token | string | - |
options | Partial<ClientOptions> | Client options to customize every thing, such as API version, URLs, sharding, etc... |
workerId | number | - |
Returns
Overrides
Defined in
src/core/cluster/ClusterClient.ts:8 (opens in a new tab)
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
#token | protected | string | The Discord authorization token. | Client.#token | src/core/Client.ts:36 (opens in a new tab) |
cache | public | ClientCacheManager | Client cache utility will store Guild objects when received from Discord gateway and API, | Client.cache | src/core/Client.ts:61 (opens in a new tab) |
events | public | ClientEvents | All events received from Discord gateway and other utility events. | Client.events | src/core/Client.ts:71 (opens in a new tab) |
ipc | public | IPC | - | - | src/core/cluster/ClusterClient.ts:5 (opens in a new tab) |
options | public | ClientOptions | Client options to customize every thing, such as API version, URLs, sharding, etc... | Client.options | src/core/Client.ts:56 (opens in a new tab) |
ready | public | boolean | Whether has completed the initialization setup and is fully connected to Discord gateway. | Client.ready | src/core/Client.ts:51 (opens in a new tab) |
rest | public | RequestManager | Utility class to handle all HTTPS requests to Discord API. | Client.rest | src/core/Client.ts:41 (opens in a new tab) |
shards | public | GatewayManager | Gateway manager, handle all shards connection. | Client.shards | src/core/Client.ts:46 (opens in a new tab) |
user? | public | User | The client user. | Client.user | src/core/Client.ts:66 (opens in a new tab) |
workerId | public | number | - | - | 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
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>