on command error discord py code example
Example 1: discord.py on command error
@client.event() #Replace 'client' with whatever neccesary
async def on_command_error(ctx, error):
if isinstance(error, commands.MissingRequiredArguments):
# Replace MissingRequiredArguments with your error
ctx.send("Please pass all required arguments")
Example 2: how to add multiple arguments in discord commands rewrite
@bot.command()
async def args(ctx, arg1, arg2):
await bot.say('You sent {} and {}'.format(arg1, arg2))