mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
feat(ws): custom workers (#9004)
* feat(ws): custom workers * chore: typo * refactor(WebSocketShard): expose shard id * chore: remove outdated readme comment * chore: nits * chore: remove unnecessary mutation * feat: fancier resolution * chore: remove unnecessary exports * chore: apply suggestions * refactor: use range errors Co-authored-by: Aura Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -67,7 +67,10 @@ export class SimpleShardingStrategy implements IShardingStrategy {
|
||||
*/
|
||||
public async send(shardId: number, payload: GatewaySendPayload) {
|
||||
const shard = this.shards.get(shardId);
|
||||
if (!shard) throw new Error(`Shard ${shardId} not found`);
|
||||
if (!shard) {
|
||||
throw new RangeError(`Shard ${shardId} not found`);
|
||||
}
|
||||
|
||||
return shard.send(payload);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user