mirror of
https://github.com/myned/modufur.git
synced 2024-12-23 22:27:27 +00:00
Added temp silencing of discord NotFound errors
This commit is contained in:
parent
e0867a1c03
commit
6d790fdbfe
1 changed files with 5 additions and 2 deletions
|
@ -9,6 +9,7 @@ from contextlib import suppress
|
|||
from pprint import pprint
|
||||
|
||||
import discord as d
|
||||
from discord import errors as err
|
||||
from discord import utils
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands import errors as errext
|
||||
|
@ -86,8 +87,10 @@ async def on_error(error, *args, **kwargs):
|
|||
|
||||
@bot.event
|
||||
async def on_command_error(ctx, error):
|
||||
if isinstance(error, errext.CheckFailure):
|
||||
await ctx.send('\N{NO ENTRY} **Insufficient permissions**', delete_after=10)
|
||||
if isinstance(error, err.NotFound):
|
||||
pass
|
||||
elif isinstance(error, errext.CheckFailure):
|
||||
await ctx.send('**Insufficient permissions**', delete_after=10)
|
||||
await ctx.message.add_reaction('\N{NO ENTRY}')
|
||||
elif isinstance(error, errext.CommandNotFound):
|
||||
print('INVALID COMMAND : {}'.format(error), file=sys.stderr)
|
||||
|
|
Loading…
Reference in a new issue