message.py 文件源码

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

项目:RandTalkBot 作者: quasiyoke 项目源码 文件源码
def __init__(self, message_json):
        try:
            content_type, chat_type, chat_id = telepot.glance(message_json)
        except KeyError:
            raise UnsupportedContentError()
        if 'forward_from' in message_json:
            raise UnsupportedContentError()
        self.is_reply = 'reply_to_message' in message_json
        self.text = message_json.get('text')
        self.type = content_type
        self.command = None
        self.command_args = None
        try:
            init_method = getattr(self, '_init_' + content_type)
        except AttributeError:
            raise UnsupportedContentError()
        init_method(message_json)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号