Rewrite of AutoShardedClient to prevent overlapping identify
This is experimental and I'm unsure if it actually works
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user