mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
8 lines
252 B
TypeScript
8 lines
252 B
TypeScript
import { GatewayManager } from "../gateway/gatewayManager.ts";
|
|
|
|
export function calculateShardId(gateway: GatewayManager, guildId: bigint) {
|
|
if (gateway.maxShards === 1) return 0;
|
|
|
|
return Number((guildId >> 22n) % BigInt(gateway.maxShards - 1));
|
|
}
|