From b05561e254e90bdc23f0cc524e38c84ff8d21dd3 Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 17 Oct 2017 01:49:52 -0400 Subject: [PATCH] Suppressed AttributeError for dms --- src/main/misc/checks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/misc/checks.py b/src/main/misc/checks.py index 47c1c6b..1c080e8 100644 --- a/src/main/misc/checks.py +++ b/src/main/misc/checks.py @@ -53,8 +53,9 @@ def is_nsfw(): def del_ctx(): async def predicate(ctx): - if ctx.guild.id in u.settings['del_ctx'] and ctx.me.permissions_in(ctx.channel).manage_messages and isinstance(ctx.message.channel, d.TextChannel): - with suppress(err.NotFound): - await ctx.message.delete() + with suppress(AttributeError): + if ctx.guild.id in u.settings['del_ctx'] and ctx.me.permissions_in(ctx.channel).manage_messages and isinstance(ctx.message.channel, d.TextChannel): + with suppress(err.NotFound): + await ctx.message.delete() return True return commands.check(predicate)