From b917904c1b448e324aed8f41b8827530556b59c2 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 6 Jul 2022 05:54:18 -0400 Subject: [PATCH] Prevent launching shards when bot is closed Fix #8210 --- discord/shard.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/shard.py b/discord/shard.py index b7b1e0fdf..4dd021e93 100644 --- a/discord/shard.py +++ b/discord/shard.py @@ -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()