From f85e969dc65e86643f32b6a1676a16408b5fb241 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 15 Oct 2017 01:35:20 -0400 Subject: [PATCH] Caught failures to delete command invocations --- src/main/misc/checks.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/misc/checks.py b/src/main/misc/checks.py index bcf7ae6..0c9891c 100644 --- a/src/main/misc/checks.py +++ b/src/main/misc/checks.py @@ -3,8 +3,9 @@ import json import traceback import discord +from discord import errors as err from discord.ext import commands -from discord.ext.commands import errors +from discord.ext.commands import errors as errext from utils import utils as u @@ -59,6 +60,11 @@ def is_nsfw(): def del_ctx(): async def predicate(ctx): if ctx.me.permissions_in(ctx.channel).manage_messages is True and isinstance(ctx.message.channel, discord.TextChannel) and ctx.guild.id in u.settings['del_ctx']: - await ctx.message.delete() + try: + await ctx.message.delete() + + except err.NotFound: + pass + return True return commands.check(predicate)