mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Made Contact implement JsonDeserializable.
This commit is contained in:
parent
36ba21643b
commit
bc3e2115ac
@ -283,10 +283,10 @@ class Video(JsonDeserializable):
|
|||||||
self.caption = caption
|
self.caption = caption
|
||||||
|
|
||||||
|
|
||||||
class Contact:
|
class Contact(JsonDeserializable):
|
||||||
@classmethod
|
@classmethod
|
||||||
def de_json(cls, json_string):
|
def de_json(cls, json_string):
|
||||||
obj = json.loads(json_string)
|
obj = cls.check_json(json_string)
|
||||||
phone_number = obj['phone_number']
|
phone_number = obj['phone_number']
|
||||||
first_name = obj['first_name']
|
first_name = obj['first_name']
|
||||||
last_name = None
|
last_name = None
|
||||||
|
Loading…
Reference in New Issue
Block a user