mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 14:27:27 +00:00
Caught failures to delete command invocations
This commit is contained in:
parent
0b6b964504
commit
f85e969dc6
1 changed files with 8 additions and 2 deletions
|
@ -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']:
|
||||
try:
|
||||
await ctx.message.delete()
|
||||
|
||||
except err.NotFound:
|
||||
pass
|
||||
|
||||
return True
|
||||
return commands.check(predicate)
|
||||
|
|
Loading…
Reference in a new issue