1
0
Fork 0
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:
Myned 2017-10-15 01:35:20 -04:00
parent 0b6b964504
commit f85e969dc6

View file

@ -3,8 +3,9 @@ import json
import traceback import traceback
import discord import discord
from discord import errors as err
from discord.ext import commands 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 from utils import utils as u
@ -59,6 +60,11 @@ def is_nsfw():
def del_ctx(): def del_ctx():
async def predicate(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']: 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 True
return commands.check(predicate) return commands.check(predicate)