From 005a80303f6b8e0199da5d9685d860c9b529172e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 24 Sep 2020 01:17:04 -0400 Subject: Add chunk_guilds_at_startup and deprecate fetch_offline_members --- discord/shard.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'discord/shard.py') 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. -- cgit v1.2.3