mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 00:40:07 +00:00
8 lines
253 B
TypeScript
8 lines
253 B
TypeScript
import { GatewayManager } from "../gateway/gateway_manager.ts";
|
|
|
|
export function calculateShardId(gateway: GatewayManager, guildId: bigint) {
|
|
if (gateway.maxShards === 1) return 0;
|
|
|
|
return Number((guildId >> 22n) % BigInt(gateway.maxShards - 1));
|
|
}
|