From de88217c37e07128188efbe0ce7684bb8e4d3a01 Mon Sep 17 00:00:00 2001 From: eternnoir Date: Fri, 3 Jul 2015 09:41:11 +0800 Subject: [PATCH] Support chat action in message. --- telebot/types.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/telebot/types.py b/telebot/types.py index 7056a77..ab292d4 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -138,6 +138,18 @@ class Message(JsonDeserializable): if 'contact' in obj: opts['contact'] = Contact.de_json(json.dumps(obj['contact'])) content_type = 'contact' + if 'new_chat_participant' in obj: + opts['new_chat_participant'] = User.de_json(obj['new_chat_participant']) + content_type = 'new_chat_participant' + if 'left_chat_participant' in obj: + opts['left_chat_participant'] = User.de_json(obj['left_chat_participant']) + content_type = 'left_chat_participant' + if 'new_chat_title' in obj: + opts['new_chat_title'] = obj['new_chat_title'] + content_type = 'new_chat_title' + if 'new_chat_photo' in obj: + opts['new_chat_photo'] = obj['new_chat_photo'] + content_type = 'new_chat_photo' return Message(message_id, from_user, date, chat, content_type, opts) @classmethod