1
0
Fork 0
mirror of synced 2024-05-17 19:12:33 +12:00

Corrected how to check for permission errors

This commit is contained in:
Phxntxm 2016-09-22 20:48:18 -05:00
parent 6c8b592d12
commit 3aec94a5cc

8
bot.py
View file

@ -97,8 +97,12 @@ async def on_message(message):
async def on_command_error(error, ctx):
if isinstance(error, commands.CommandNotFound):
return
if error.original and isinstance(error.original, discord.Forbidden):
return
try:
if isinstance(error.original, discord.Forbidden):
return
except AttributeError:
pass
if isinstance(error, commands.BadArgument):
fmt = "Please provide a valid argument to pass to the command: {}".format(error)
await bot.send_message(ctx.message.channel, fmt)