aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-04-13 12:04:33 -0700
committerZeyla Hellyer <[email protected]>2017-04-13 12:04:33 -0700
commitf0d1157212397ae377e11d4205abfebc849ba9d8 (patch)
treea69d5e1618b427bb3ee1ab595e8e632fea4b6666 /src
parentAdd Shard Id helpers (diff)
downloadserenity-f0d1157212397ae377e11d4205abfebc849ba9d8.tar.xz
serenity-f0d1157212397ae377e11d4205abfebc849ba9d8.zip
Default to using [0, 1] shards
When using an unsharded client, the shard data sent in the IDENTIFY should default to `[0, 1]`, as sending a null value results in a 4010 response code. The response code for the error looks like: ``` WARN:serenity::client: Failed to boot shard: Gateway(Closed(Some(4010), "Invalid shard.")) WARN:serenity::client: Error starting shard None: Client(ShardBootFailure) ```
Diffstat (limited to 'src')
-rw-r--r--src/client/gateway/prep.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/gateway/prep.rs b/src/client/gateway/prep.rs
index 4a9b5de..5609749 100644
--- a/src/client/gateway/prep.rs
+++ b/src/client/gateway/prep.rs
@@ -59,7 +59,7 @@ pub fn identify(token: &str, shard_info: Option<[u64; 2]>) -> Value {
"d": {
"compression": !cfg!(feature="debug"),
"large_threshold": LARGE_THRESHOLD,
- "shard": shard_info,
+ "shard": shard_info.unwrap_or([0, 1]),
"token": token,
"v": constants::GATEWAY_VERSION,
"properties": {