aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/verification.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/bot/cogs/verification.py b/bot/cogs/verification.py
index 83a31c15a..d9e27d652 100644
--- a/bot/cogs/verification.py
+++ b/bot/cogs/verification.py
@@ -1,6 +1,6 @@
import logging
-from discord import Message, Object
+from discord import Message, Object, NotFound
from discord.ext.commands import Bot, Context, command
from bot.constants import Channels, Roles
@@ -42,7 +42,11 @@ class Verification:
)
log.trace(f"Deleting the message posted by {ctx.author}")
- await ctx.message.delete()
+
+ try:
+ await ctx.message.delete()
+ except NotFound:
+ log.trace("No message found, it must have been deleted by another bot.")
@command(name="accept", hidden=True, aliases=["verify", "verified", "accepted", "accept()"])
@without_role(Roles.verified)
@@ -56,7 +60,11 @@ class Verification:
await ctx.author.add_roles(Object(Roles.verified), reason="Accepted the rules")
log.trace(f"Deleting the message posted by {ctx.author}.")
- await ctx.message.delete()
+
+ try:
+ await ctx.message.delete()
+ except NotFound:
+ log.trace("No message found, it must have been deleted by another bot.")
def setup(bot):