def on_command_error(error, ctx):
if isinstance(error, commands.NoPrivateMessage):
await bot.send_message(ctx.message.author, 'This command cannot be used in private messages.')
elif isinstance(error, commands.DisabledCommand):
await bot.send_message(ctx.message.author, 'Sorry. This command is disabled and cannot be used.')
elif isinstance(error, commands.MissingRequiredArgument):
command = ctx.message.content.split()[1]
await bot.send_message(ctx.message.channel, "Missing an argument: try gsbot help or gsbot help " + command)
elif isinstance(error, commands.CommandNotFound):
await bot.send_message(ctx.message.channel, codify("I don't know that command: try gsbot help"))
评论列表
文章目录