aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar zephyrus <[email protected]>2021-11-24 21:57:48 +0530
committerGravatar GitHub <[email protected]>2021-11-24 16:27:48 +0000
commit2024766f182b1491e8d2031e3e26d0830563e578 (patch)
tree2566740ab2f5719f766339ccacc1f37af9c60727
parentMerge pull request #1971 from python-discord/optional-timeblocks (diff)
Suppress NotFound error when cleaning messages
* Added suppress for notfound error * Update clean.py
-rw-r--r--bot/exts/moderation/clean.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/moderation/clean.py b/bot/exts/moderation/clean.py
index 94494b983..826265aa3 100644
--- a/bot/exts/moderation/clean.py
+++ b/bot/exts/moderation/clean.py
@@ -293,7 +293,8 @@ class Clean(Cog):
return deleted
if len(to_delete) > 0:
# Deleting any leftover messages if there are any
- await channel.delete_messages(to_delete)
+ with suppress(NotFound):
+ await channel.delete_messages(to_delete)
deleted.extend(to_delete)
if not self.cleaning: