You are reading the documentation for the next version of discord.js. Documentation for v13/v14+ has been moved to old.discordjs.dev

WorkerShardingStrategy

export declare class WorkerShardingStrategy implements IShardingStrategy
export declare class WorkerShardingStrategy implements IShardingStrategy
Strategy used to spawn threads in worker_threads
constructor(manager, options)
Constructs a new instance of the WorkerShardingStrategy class
NameTypeOptionalDescription
managerWebSocketManagerNoNone
optionsWorkerShardingStrategyOptionsNoNone
connect():Promise<void>
Initializes all the shards
destroy(options?):Promise<void>
Destroys all the shards
NameTypeOptionalDescription
optionsOmit<WebSocketShardDestroyOptions, 'recover'>YesNone
fetchStatus():Promise<Collection<number, WebSocketShardStatus>>
Fetches the status of all the shards
send(shardId, data):void
Sends a payload to a shard
NameTypeOptionalDescription
shardIdnumberNoNone
dataGatewaySendPayloadNoNone
spawn(shardIds):Promise<void>
Spawns all the shards
NameTypeOptionalDescription
shardIdsnumber[]NoNone