From d5fe82687cb60815eb4fe1b56aeafa934bd4b91a Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 4 Apr 2018 22:37:40 +0200 Subject: [PATCH] Handle Sticker type --- pyrogram/client/utils.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/utils.py b/pyrogram/client/utils.py index 93f8b4ee..6a5042a8 100644 --- a/pyrogram/client/utils.py +++ b/pyrogram/client/utils.py @@ -142,6 +142,7 @@ def parse_message(message: types.Message, users: dict, chats: dict): voice = None video = None video_note = None + sticker = None media = message.media @@ -277,6 +278,25 @@ def parse_message(message: types.Message, users: dict, chats: dict): mime_type=doc.mime_type, file_size=doc.size ) + elif types.DocumentAttributeSticker in attributes: + image_size_attribute = attributes[types.DocumentAttributeImageSize] + + sticker = pyrogram.Sticker( + file_id=encode( + pack( + "