From 452da1a06287d964acb17d43db9bce3f7090eebf Mon Sep 17 00:00:00 2001 From: Amrou Bellalouna Date: Mon, 3 Oct 2022 16:45:50 +0100 Subject: await unawaited remove_cog calls --- bot/exts/filters/antispam.py | 2 +- bot/exts/help_channels/_cog.py | 2 +- bot/exts/moderation/watchchannels/_watchchannel.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/filters/antispam.py b/bot/exts/filters/antispam.py index 842aab384..b4e7a33f0 100644 --- a/bot/exts/filters/antispam.py +++ b/bot/exts/filters/antispam.py @@ -156,7 +156,7 @@ class AntiSpam(Cog): colour=Colour.red() ) - self.bot.remove_cog(self.__class__.__name__) + await self.bot.remove_cog(self.__class__.__name__) return @Cog.listener() diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py index f1351013a..31a33f8af 100644 --- a/bot/exts/help_channels/_cog.py +++ b/bot/exts/help_channels/_cog.py @@ -315,7 +315,7 @@ class HelpChannels(commands.Cog): ) except discord.HTTPException: log.exception("Failed to get a category; cog will be removed") - self.bot.remove_cog(self.qualified_name) + await self.bot.remove_cog(self.qualified_name) async def cog_load(self) -> None: """Initialise the help channel system.""" diff --git a/bot/exts/moderation/watchchannels/_watchchannel.py b/bot/exts/moderation/watchchannels/_watchchannel.py index 46f9c296e..6eaedf6b3 100644 --- a/bot/exts/moderation/watchchannels/_watchchannel.py +++ b/bot/exts/moderation/watchchannels/_watchchannel.py @@ -128,7 +128,7 @@ class WatchChannel(metaclass=CogABCMeta): colour=Color.red() ) - self.bot.remove_cog(self.__class__.__name__) + await self.bot.remove_cog(self.__class__.__name__) return if not await self.fetch_user_cache(): -- cgit v1.2.3