1
0
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:
eternnoir 2015-09-05 17:58:53 +08:00
parent f2f556ed12
commit 2d5cb4fd75

View File

@ -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