diff options
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/discord/state.py b/discord/state.py index f84d85ba..6148889d 100644 --- a/discord/state.py +++ b/discord/state.py @@ -1047,6 +1047,7 @@ class AutoShardedConnectionState(ConnectionState): super().__init__(*args, **kwargs) self._ready_task = None self.shard_ids = () + self.shards_launched = asyncio.Event() async def chunker(self, guild_id, query='', limit=0, *, shard_id=None, nonce=None): ws = self._get_websocket(guild_id, shard_id=shard_id) @@ -1073,6 +1074,7 @@ class AutoShardedConnectionState(ConnectionState): log.info('Finished requesting guild member chunks for %d guilds.', len(guilds)) async def _delay_ready(self): + await self.shards_launched.wait() launch = self._ready_state.launch while True: # this snippet of code is basically waiting 2 * shard_ids seconds |