Helper class for sharded clients spawned as a child process/worker, such as from a ShardingManager. Utilises IPC to send and receive data to/from the master process and other shards.
Fetches a client property value of each shard, or a given shard.
Example
Name | Type | Optional | Description |
---|---|---|---|
prop | string | No | Name of the client property to get, using periods for nesting |
Requests a respawn of all shards.
Returns
Resolves upon the message being sentName | Type | Optional | Description |
---|---|---|---|
options | MultipleShardRespawnOptions | Yes | Options for respawning shards |
Sends a message to the master process.
Name | Type | Optional | Description |
---|---|---|---|
message | unknown | No | Message to send |
Get the shard id for a given guild id.
Creates/gets the singleton of this class.
Name | Type | Optional | Description |
---|---|---|---|
client | Client<true> | No | The client to use |
mode | ShardingManagerMode | No | Mode the shard was spawned with |