mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
feat(core): implement some ws send events (#8941)
* feat(core): implement some ws send events * fix: check guild id and add a timeout * fix: only check for nonce * chore: update readme * chore: make requested changes * chore: make methods consistent * chore: fix readme example * chore: move shard ID calculation to util Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
3
packages/util/src/functions/calculateShardId.ts
Normal file
3
packages/util/src/functions/calculateShardId.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function calculateShardId(guildId: string, shardCount: number) {
|
||||
return Number((BigInt(guildId) >> 22n) % BigInt(shardCount));
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './lazy.js';
|
||||
export * from './range.js';
|
||||
export * from './calculateShardId.js';
|
||||
|
||||
Reference in New Issue
Block a user