mirror of
https://github.com/myned/modufur.git
synced 2024-12-23 22:27:27 +00:00
Suppressed AttributeError for dms
This commit is contained in:
parent
16c7985942
commit
b05561e254
1 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue