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:
Suneet Tipirneni
2023-01-05 17:06:50 -05:00
committed by GitHub
parent 3407e1eea3
commit 816aed478e
6 changed files with 182 additions and 75 deletions

View File

@@ -0,0 +1,3 @@
export function calculateShardId(guildId: string, shardCount: number) {
return Number((BigInt(guildId) >> 22n) % BigInt(shardCount));
}

View File

@@ -1,2 +1,3 @@
export * from './lazy.js';
export * from './range.js';
export * from './calculateShardId.js';