mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Add Update class.
This commit is contained in:
parent
f2f556ed12
commit
2d5cb4fd75
@ -78,6 +78,17 @@ class JsonDeserializable:
|
|||||||
|
|
||||||
return unicode(d)
|
return unicode(d)
|
||||||
|
|
||||||
|
class Update(JsonDeserializable):
|
||||||
|
@classmethod
|
||||||
|
def de_json(cls, json_type):
|
||||||
|
obj = cls.check_json(json_type)
|
||||||
|
update_id = obj['update_id']
|
||||||
|
message = Message.de_json(obj['message'])
|
||||||
|
return Update(update_id, message)
|
||||||
|
|
||||||
|
def __init__(self, update_id, message):
|
||||||
|
self.update_id = update_id
|
||||||
|
self.message = message
|
||||||
|
|
||||||
class User(JsonDeserializable):
|
class User(JsonDeserializable):
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user