1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-24 22:27:28 +00:00

Suppressed AttributeError for dms

This commit is contained in:
Myned 2017-10-17 01:49:52 -04:00
parent 16c7985942
commit b05561e254

View file

@ -53,8 +53,9 @@ def is_nsfw():
def del_ctx(): def del_ctx():
async def predicate(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(AttributeError):
with suppress(err.NotFound): 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):
await ctx.message.delete() with suppress(err.NotFound):
await ctx.message.delete()
return True return True
return commands.check(predicate) return commands.check(predicate)