__init__.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:StreamNotificationBot 作者: ivandardi 项目源码 文件源码
def on_command_error(self, ctx, error):
        if isinstance(error, commands.NoPrivateMessage):
            return await ctx.send('This command cannot be used in private messages.')
        if isinstance(error, commands.DisabledCommand):
            return await ctx.send('Sorry. This command is disabled and cannot be used.')
        if isinstance(error, commands.CommandNotFound):
            return await ctx.send('Type `snb?help` for help on valid commands.')
        if isinstance(error, errors.StreamNotificationBotError):
            return log.error('StreamNotificationBotError: %s', error)
        if isinstance(error, commands.CommandInvokeError):
            return log.error('CommandInvokeError: %s', error)
        tb = ''.join(traceback.format_exception(type(error), error, error.__traceback__))
        log.error(f'Command error in %s:\n%s', ctx.command.qualified_name, tb)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号