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)
评论列表
文章目录