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:
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
|
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)
|
||||||
|
|
Loading…
Reference in a new issue