Move all async object creation to a proper initialisation point

This should make it so no object is created with another loop
This commit is contained in:
Rapptz committed 2022-03-13 08:33:25 -04:00
1 parent 8d4f08a5e7
commit 9c61e10a55
4 files changed
+45 -27

No files matched your search

+4 -1
View File
@@ -424,8 +424,11 @@ class AutoShardedClient(Client):
self._connection.shards_launched.set()
async def connect(self, *, reconnect: bool = True) -> None:
async def _async_setup_hook(self) -> None:
await super()._async_setup_hook()
self.__queue = asyncio.PriorityQueue()
async def connect(self, *, reconnect: bool = True) -> None:
self._reconnect = reconnect
await self.launch_shards()