From 1318fce81a47fedab4884202b2cff244a7a8a28b Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sun, 18 Sep 2016 16:13:41 -0500 Subject: [PATCH] Added a catch for when the bot's message has already been deleted --- cogs/mod.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cogs/mod.py b/cogs/mod.py index 69acc00..f38d1f8 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -308,7 +308,10 @@ class Mod: break msg = await self.bot.say("{} messages succesfully deleted".format(count)) await asyncio.sleep(60) - await self.bot.delete_message(msg) + try: + await self.bot.delete_message(msg) + except discord.NotFound: + pass @commands.group(aliases=['rule'], pass_context=True, no_pm=True, invoke_without_command=True) @checks.custom_perms(send_messages=True)