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

Update types.py

Sending stickers everytime have different file_id, so for detecting special stickers we need a unique parameter.
This commit is contained in:
Purya Jafari 2020-07-07 01:31:33 +04:30 committed by GitHub
parent f42ec4fe0d
commit 49398f5c61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2204,6 +2204,7 @@ class Sticker(JsonDeserializable):
if (json_string is None): return None if (json_string is None): return None
obj = cls.check_json(json_string) obj = cls.check_json(json_string)
file_id = obj['file_id'] file_id = obj['file_id']
file_unique_id = obj['file_unique_id']
width = obj['width'] width = obj['width']
height = obj['height'] height = obj['height']
is_animated = obj['is_animated'] is_animated = obj['is_animated']
@ -2212,10 +2213,11 @@ class Sticker(JsonDeserializable):
set_name = obj.get('set_name') set_name = obj.get('set_name')
mask_position = MaskPosition.de_json(obj.get('mask_position')) mask_position = MaskPosition.de_json(obj.get('mask_position'))
file_size = obj.get('file_size') file_size = obj.get('file_size')
return cls(file_id, width, height, thumb, emoji, set_name, mask_position, file_size, is_animated) return cls(file_id, file_unique_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, is_animated): def __init__(self, file_id, file_unique_id, width, height, thumb, emoji, set_name, mask_position, file_size, is_animated):
self.file_id = file_id self.file_id = file_id
self.file_unique_id = file_unique_id
self.width = width self.width = width
self.height = height self.height = height
self.thumb = thumb self.thumb = thumb