Prevent launching shards when bot is closed

Fix #8210
This commit is contained in:
Rapptz 2022-07-06 05:54:18 -04:00
parent 9fe19dcc69
commit b917904c1b

View File

@ -416,6 +416,9 @@ class AutoShardedClient(Client):
ret.launch()
async def launch_shards(self) -> None:
if self.is_closed():
return
if self.shard_count is None:
self.shard_count: int
self.shard_count, gateway = await self.http.get_bot_gateway()