mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Fix Sticker parsing
This commit is contained in:
parent
bb450d1cef
commit
803f8f0073
@ -148,10 +148,12 @@ class Sticker(Object):
|
||||
sticker: "raw.types.Document",
|
||||
document_attributes: Dict[Type["raw.base.DocumentAttribute"], "raw.base.DocumentAttribute"],
|
||||
) -> "Sticker":
|
||||
sticker_attributes = document_attributes.get(
|
||||
raw.types.DocumentAttributeSticker,
|
||||
document_attributes[raw.types.DocumentAttributeCustomEmoji]
|
||||
sticker_attributes = (
|
||||
document_attributes[raw.types.DocumentAttributeSticker]
|
||||
if raw.types.DocumentAttributeSticker in document_attributes
|
||||
else document_attributes[raw.types.DocumentAttributeCustomEmoji]
|
||||
)
|
||||
|
||||
image_size_attributes = document_attributes.get(raw.types.DocumentAttributeImageSize, None)
|
||||
file_name = getattr(document_attributes.get(raw.types.DocumentAttributeFilename, None), "file_name", None)
|
||||
video_attributes = document_attributes.get(raw.types.DocumentAttributeVideo, None)
|
||||
|
Loading…
Reference in New Issue
Block a user