Like ?ukasz said, replace your on_message_error
with on_command_error
. You can view this in the docs here.
@client.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound): # or discord.ext.commands.errors.CommandNotFound as you wrote
await ctx.send("Unknown command")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…