aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/moderation/clean.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/moderation/clean.py b/bot/exts/moderation/clean.py
index af79d5a35..3fb2c2870 100644
--- a/bot/exts/moderation/clean.py
+++ b/bot/exts/moderation/clean.py
@@ -588,6 +588,10 @@ class Clean(Cog):
"""Only allow moderators to invoke the commands in this cog."""
return await has_any_role(*MODERATION_ROLES).predicate(ctx)
+ async def cog_command_error(self, ctx: Context, error: Exception) -> None:
+ """Safely end the cleaning operation on unexpected errors."""
+ self.cleaning = False
+
def setup(bot: Bot) -> None:
"""Load the Clean cog."""