1 /**
2 Utilties related to Discord Guild sharding.
3 */
4 module dscord.util.sharding;
5
6 import dscord.types;
7
8 /// Returns the shard number a given snowflake is on (given the number of shards)
9 ushort shardNumber(Snowflake id, ushort numShards) {
10 return (id >> 22) % numShards;
11 }