def __error(self, ctx, error):
if isinstance(error, commands.BadArgument):
await ctx.send(error)
elif isinstance(error, commands.CommandInvokeError):
original = error.original
if isinstance(original, discord.Forbidden):
await ctx.send('I do not have permission to execute this action.')
elif isinstance(original, discord.NotFound):
await ctx.send(f'This entity does not exist: {original.text}')
elif isinstance(original, discord.HTTPException):
await ctx.send('Somehow, an unexpected error occurred. Try again later?')
评论列表
文章目录