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

Added temp silencing of discord NotFound errors

This commit is contained in:
Myned 2017-11-08 22:32:06 -05:00
parent e0867a1c03
commit 6d790fdbfe

View file

@ -9,6 +9,7 @@ from contextlib import suppress
from pprint import pprint from pprint import pprint
import discord as d import discord as d
from discord import errors as err
from discord import utils from discord import utils
from discord.ext import commands from discord.ext import commands
from discord.ext.commands import errors as errext from discord.ext.commands import errors as errext
@ -86,8 +87,10 @@ async def on_error(error, *args, **kwargs):
@bot.event @bot.event
async def on_command_error(ctx, error): async def on_command_error(ctx, error):
if isinstance(error, errext.CheckFailure): if isinstance(error, err.NotFound):
await ctx.send('\N{NO ENTRY} **Insufficient permissions**', delete_after=10) pass
elif isinstance(error, errext.CheckFailure):
await ctx.send('**Insufficient permissions**', delete_after=10)
await ctx.message.add_reaction('\N{NO ENTRY}') await ctx.message.add_reaction('\N{NO ENTRY}')
elif isinstance(error, errext.CommandNotFound): elif isinstance(error, errext.CommandNotFound):
print('INVALID COMMAND : {}'.format(error), file=sys.stderr) print('INVALID COMMAND : {}'.format(error), file=sys.stderr)