Reputation: 49
I want my bot to make some kind of command log and I want it not only send that "some command was just executed", but also send if user raised any errors while trying to use this command (missing argument/permission and so on). I want to implement it using on_command_error()
, but I still need to know which command raised the error. Is there any way of doing that?
Upvotes: 0
Views: 1222
Reputation: 133
Because you get the ctx from the failed command, you can access the command name with ctx.invoked_with
or ctx.command
if you want the full command object.
...
@bot.event
async def on_command_error(ctx, error):
command = ctx.invoked_with
Upvotes: 2