Support for animated stickers

This commit is contained in:
cmd410 2019-07-30 12:46:39 +03:00
parent 151880f391
commit f0835a1a14
1 changed files with 4 additions and 2 deletions

View File

@ -2035,6 +2035,7 @@ class Sticker(JsonDeserializable):
file_id = obj['file_id']
width = obj['width']
height = obj['height']
is_animated = obj['is_animated']
thumb = None
if 'thumb' in obj:
thumb = PhotoSize.de_json(obj['thumb'])
@ -2044,9 +2045,9 @@ class Sticker(JsonDeserializable):
if 'mask_position' in obj:
mask_position = MaskPosition.de_json(obj['mask_position'])
file_size = obj.get('file_size')
return cls(file_id, width, height, thumb, emoji, set_name, mask_position, file_size)
return cls(file_id, width, height, thumb, emoji, set_name, mask_position, file_size, is_animated)
def __init__(self, file_id, width, height, thumb, emoji, set_name, mask_position, file_size):
def __init__(self, file_id, width, height, thumb, emoji, set_name, mask_position, file_size, is_animated):
self.file_id = file_id
self.width = width
self.height = height
@ -2055,6 +2056,7 @@ class Sticker(JsonDeserializable):
self.set_name = set_name
self.mask_position = mask_position
self.file_size = file_size
self.is_animated = is_animated
class MaskPosition(JsonDeserializable, JsonSerializable):