diff options
| author | Rapptz <[email protected]> | 2020-09-24 01:17:04 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-09-24 01:17:04 -0400 |
| commit | 005a80303f6b8e0199da5d9685d860c9b529172e (patch) | |
| tree | cf17a3a3b3c7d8d36cb18c476b2ebf2f39c3ff63 /discord/shard.py | |
| parent | Fix typos in Intents documentation (diff) | |
| download | discord.py-005a80303f6b8e0199da5d9685d860c9b529172e.tar.xz discord.py-005a80303f6b8e0199da5d9685d860c9b529172e.zip | |
Add chunk_guilds_at_startup and deprecate fetch_offline_members
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. |