.await
} else {
info!("Sending login");
+ let mut shards: Option<[u64; 2]> = None;
+ if let Some(sharding) = self.config.shard.as_ref() {
+ shards = Some([sharding.current_shard, sharding.total_shards]);
+ }
self._send(BaseMessage {
t: None,
sequence: None,
browser: "Nova".to_string(),
device: "Nova".to_string(),
},
- shard: Some([0, 2]),
+ shard: shards,
compress: Some(false),
large_threshold: Some(500),
presence: None,
#[derive(Debug, Deserialize, Serialize, Default, Clone)]
pub struct Sharding {
- pub total_shards: i64,
- pub current_shard: i64
+ pub total_shards: u64,
+ pub current_shard: u64
}
-
#[derive(Debug, Deserialize, Serialize, Default, Clone)]
pub struct ShardConfig {
pub max_reconnects: usize,