1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Add user to MessageEntity.

This commit is contained in:
eternnoir 2016-05-23 11:12:20 +08:00
parent f9c7497c5c
commit 8c20f63022

View File

@ -311,13 +311,17 @@ class MessageEntity(JsonDeserializable):
offset = obj['offset']
length = obj['length']
url = obj.get('url')
return cls(type, offset, length, url)
user = None
if 'user' in obj:
user = User.de_json(obj['user'])
return cls(type, offset, length, url, user)
def __init__(self, type, offset, length, url=None):
def __init__(self, type, offset, length, url=None, user=None):
self.type = type
self.offset = offset
self.length = length
self.url = url
self.user = user
class PhotoSize(JsonDeserializable):