Function shard_id

Source
pub fn shard_id(guild_id: GuildId, shard_count: u32) -> u32
Expand description

Calculates the Id of the shard responsible for a guild, given its Id and total number of shards used.

ยงExamples

Retrieve the Id of the shard for a guild with Id 81384788765712384, using 17 shards:

use serenity::model::id::GuildId;
use serenity::utils;

assert_eq!(utils::shard_id(GuildId::new(81384788765712384), 17), 7);