lagbot.py 文件源码

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

项目:lagbot 作者: mikevb1 项目源码 文件源码
def on_command_error(self, ctx, exc):
        """Emulate default on_command_error and add guild + channel info."""
        if hasattr(ctx.command, 'on_error') or getattr(exc, 'handled', False) or \
                not isinstance(exc, commands.CommandInvokeError) or isinstance(exc.original, discord.Forbidden):
            return
        msg = f'{ctx.message.content}\nin {"guild" if ctx.guild else "DM"}'
        tb = ''.join(traceback.format_exception(*tb_args(exc.original))).replace(UPPER_PATH, '...')
        logging.error('\n'.join((msg, tb)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号