diff options
Diffstat (limited to 'discord/shard.py')
| -rw-r--r-- | discord/shard.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/discord/shard.py b/discord/shard.py index 3587c097..6985d797 100644 --- a/discord/shard.py +++ b/discord/shard.py @@ -295,10 +295,6 @@ class AutoShardedClient(Client): elif not isinstance(self.shard_ids, (list, tuple)): raise ClientException('shard_ids parameter must be a list or a tuple.') - self._connection = AutoShardedConnectionState(dispatch=self.dispatch, - handlers=self._handlers, syncer=self._syncer, - hooks=self._hooks, http=self.http, loop=self.loop, **kwargs) - # instead of a single websocket, we have multiple # the key is the shard_id self.__shards = {} @@ -311,6 +307,11 @@ class AutoShardedClient(Client): shard_id = (guild_id >> 22) % self.shard_count return self.__shards[shard_id].ws + def _get_state(self, **options): + return AutoShardedConnectionState(dispatch=self.dispatch, + handlers=self._handlers, syncer=self._syncer, + hooks=self._hooks, http=self.http, loop=self.loop, **options) + @property def latency(self): """:class:`float`: Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds. |