commands.py 文件源码

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

项目:bilbot 作者: nebil 项目源码 文件源码
def logger(command):
    """
    Add a logger to the decorated command.
    """

    @wraps(command)
    # pylint: disable=bad-whitespace
    # pylint: disable=unused-argument
    def wrapper(bot, update, **kwargs):
        command(     update, **kwargs)
        if command.__name__ == 'unknown':
            command.__name__ = _get_command_name(update.message.text)
        message = LOG_TEMPLATE.format(user=update.user.first_name,
                                      command=command.__name__)
        logging.info(message)
    return wrapper
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号