aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2021-08-29 15:06:50 +0300
committerGravatar mbaruh <[email protected]>2021-08-29 15:06:50 +0300
commitfee4c0c8be7d0e7d0bcb8358bb11255feb3f66b8 (patch)
tree9ceb64688cc70afef488060e4caf4c046a3a1985
parentUse a cog-wide role check (diff)
Handle reacted message being deleted
-rw-r--r--bot/exts/moderation/clean.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/exts/moderation/clean.py b/bot/exts/moderation/clean.py
index 950c0c82e..6fb33c692 100644
--- a/bot/exts/moderation/clean.py
+++ b/bot/exts/moderation/clean.py
@@ -2,6 +2,7 @@ import logging
import re
import time
from collections import defaultdict
+from contextlib import suppress
from datetime import datetime
from itertools import islice
from typing import Any, Callable, DefaultDict, Iterable, List, Literal, Optional, TYPE_CHECKING, Tuple, Union
@@ -362,7 +363,8 @@ class Clean(Cog):
logged = await self._log_clean(deleted_messages, channels, ctx)
if logged and is_mod_channel(ctx.channel):
- await ctx.message.add_reaction(Emojis.check_mark)
+ with suppress(NotFound): # Can happen if the invoker deleted their own messages.
+ await ctx.message.add_reaction(Emojis.check_mark)
# region: Commands