I want to be able to send a message like await ctx.send("Error: Unknown command. Do -help for acceptable commands."
or something like that (FYI, I\'m not
Discord.py has a on_command_error event, which takes the error as argument. You can use it this way:
@bot.event
async def on_command_error(ctx, error):
await ctx.send(f"An error occured: {str(error)}")
Here's a list of every discord exeptions.
If you want a custom message for each error, you can do it this way:
@bot.event
async def on_message_error(ctx, error):
if isinstance(error, discord.ext.commands.errors.CommandNotFound):
await ctx.send("Unknown command")