Fix error messages not sending

This commit is contained in:
StarrFox 2020-05-12 20:37:26 -05:00
parent 6ebebe5045
commit cba238464c
1 changed files with 9 additions and 0 deletions

View File

@ -106,6 +106,15 @@ class Emotes(commands.Cog):
return True
@commands.Cog.listener()
async def on_command_error(self, context, error):
if isinstance(error, errors.EmoteManagerError):
await context.send(str(error))
if isinstance(error, commands.NoPrivateMessage):
await context.send(
f'{utils.SUCCESS_EMOJIS[False]} Sorry, this command may only be used in a server.')
@commands.command(usage='[name] <image URL or custom emote>')
async def add(self, context, *args):
"""Add a new emote to this server.