aboutsummaryrefslogtreecommitdiff
path: root/discord/shard.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/shard.py')
-rw-r--r--discord/shard.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/shard.py b/discord/shard.py
index 62bd9a3c..d3d54ab5 100644
--- a/discord/shard.py
+++ b/discord/shard.py
@@ -110,6 +110,11 @@ class AutoShardedClient(Client):
# the key is the shard_id
self.shards = {}
+ def _get_websocket(guild_id):
+ i = (guild_id >> 22) % self.shard_count
+ return self.shards[i].ws
+
+ self.connection._get_websocket = _get_websocket
self._still_sharding = True
@asyncio.coroutine