mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Update update object.
This commit is contained in:
parent
b5680a1c1f
commit
7eeda3bc4d
@ -87,12 +87,21 @@ class Update(JsonDeserializable):
|
|||||||
def de_json(cls, json_type):
|
def de_json(cls, json_type):
|
||||||
obj = cls.check_json(json_type)
|
obj = cls.check_json(json_type)
|
||||||
update_id = obj['update_id']
|
update_id = obj['update_id']
|
||||||
message = Message.de_json(obj['message'])
|
message = None
|
||||||
return cls(update_id, message)
|
inline_query = None
|
||||||
|
# TODO chosen_inline_result
|
||||||
|
chosen_inline_result = None
|
||||||
|
if 'message' in obj:
|
||||||
|
message = Message.de_json(obj['message'])
|
||||||
|
if 'inline_query' in obj:
|
||||||
|
inline_query = InlineQuery.de_json(obj['inline_query'])
|
||||||
|
return cls(update_id, message, inline_query, chosen_inline_result)
|
||||||
|
|
||||||
def __init__(self, update_id, message):
|
def __init__(self, update_id, message, inline_query, chosen_inline_result):
|
||||||
self.update_id = update_id
|
self.update_id = update_id
|
||||||
self.message = message
|
self.message = message
|
||||||
|
self.inline_query = inline_query
|
||||||
|
self.chosen_inline_result = chosen_inline_result
|
||||||
|
|
||||||
|
|
||||||
class User(JsonDeserializable):
|
class User(JsonDeserializable):
|
||||||
|
Loading…
Reference in New Issue
Block a user