aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/utils/messages.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/bot/utils/messages.py b/bot/utils/messages.py
index 90672fba2..a82096b1c 100644
--- a/bot/utils/messages.py
+++ b/bot/utils/messages.py
@@ -97,11 +97,14 @@ async def wait_for_deletion(
)
try:
- await bot.instance.wait_for('reaction_add', check=check, timeout=timeout)
- except asyncio.TimeoutError:
- await message.clear_reactions()
- else:
- await message.delete()
+ try:
+ await bot.instance.wait_for('reaction_add', check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.clear_reactions()
+ else:
+ await message.delete()
+ except discord.NotFound:
+ log.trace(f"wait_for_deletion: message {message.id} deleted prematurely.")
async def send_attachments(