Printing error when a command's requirements are missing, as based on my error log, people don't know how to use the help command
This commit is contained in:
parent
e07bc8359e
commit
7fcb0738f8
2
bot.py
2
bot.py
|
@ -93,6 +93,8 @@ async def on_command_error(error, ctx):
|
||||||
elif isinstance(error, commands.NoPrivateMessage):
|
elif isinstance(error, commands.NoPrivateMessage):
|
||||||
fmt = "This command cannot be used in a private message"
|
fmt = "This command cannot be used in a private message"
|
||||||
await bot.send_message(ctx.message.channel, fmt)
|
await bot.send_message(ctx.message.channel, fmt)
|
||||||
|
elif isinstance(error, commands.MissingRequiredArgument):
|
||||||
|
await bot.send_message(ctx.message.channel, error)
|
||||||
elif not isinstance(error, commands.CommandNotFound):
|
elif not isinstance(error, commands.CommandNotFound):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
with open("/home/phxntx5/public_html/Bonfire/error_log", 'a') as f:
|
with open("/home/phxntx5/public_html/Bonfire/error_log", 'a') as f:
|
||||||
|
|
Loading…
Reference in a new issue