From 6a98d27f1add4c411d51171d869864ccb9323d1e Mon Sep 17 00:00:00 2001 From: Kondra007 Date: Sun, 22 May 2016 13:35:21 +0300 Subject: [PATCH 1/3] Added edited_message to Update object As of Bot API update 2.1, Update object now has optional edited_message field. --- telebot/types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telebot/types.py b/telebot/types.py index adf37e1..ccf964a 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -91,6 +91,8 @@ class Update(JsonDeserializable): callback_query = None if 'message' in obj: message = Message.de_json(obj['message']) + if 'edited_message' in obj: + edited_message = Message.de_json(obj['edited_message']) if 'inline_query' in obj: inline_query = InlineQuery.de_json(obj['inline_query']) if 'chosen_inline_result' in obj: @@ -99,9 +101,10 @@ class Update(JsonDeserializable): callback_query = CallbackQuery.de_json(obj['callback_query']) return cls(update_id, message, inline_query, chosen_inline_result, callback_query) - def __init__(self, update_id, message, inline_query, chosen_inline_result, callback_query): + def __init__(self, update_id, message, edited_message, inline_query, chosen_inline_result, callback_query): self.update_id = update_id self.message = message + self.edited_message = edited_message self.inline_query = inline_query self.chosen_inline_result = chosen_inline_result self.callback_query = callback_query From 8a9d89591bb3d84912da0fd06081b10740a9a7f4 Mon Sep 17 00:00:00 2001 From: Kondra007 Date: Sun, 22 May 2016 15:44:04 +0300 Subject: [PATCH 2/3] Fixed Travis build errors --- telebot/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/types.py b/telebot/types.py index ccf964a..195cd9a 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -99,7 +99,7 @@ class Update(JsonDeserializable): chosen_inline_result = ChosenInlineResult.de_json(obj['chosen_inline_result']) if 'callback_query' in obj: callback_query = CallbackQuery.de_json(obj['callback_query']) - return cls(update_id, message, inline_query, chosen_inline_result, callback_query) + return cls(update_id, message, edited_message, inline_query, chosen_inline_result, callback_query) def __init__(self, update_id, message, edited_message, inline_query, chosen_inline_result, callback_query): self.update_id = update_id From 1a45b4844add7ecf774ccff7bbee603b0ef75766 Mon Sep 17 00:00:00 2001 From: Kondra007 Date: Sun, 22 May 2016 15:47:44 +0300 Subject: [PATCH 3/3] Fixed Travis build (again) Yeah, I'm really sorry for all this errors, maybe tired a little bit. --- telebot/types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/telebot/types.py b/telebot/types.py index 195cd9a..a8f2d44 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -86,6 +86,7 @@ class Update(JsonDeserializable): obj = cls.check_json(json_type) update_id = obj['update_id'] message = None + edited_message = None inline_query = None chosen_inline_result = None callback_query = None