mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge branch 'Kondra007-patch-3' into feature-changes20160522
This commit is contained in:
commit
f9c7497c5c
@ -86,22 +86,26 @@ 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
|
||||
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:
|
||||
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, 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
|
||||
|
Loading…
Reference in New Issue
Block a user