From 2fcd8ea54e8e72ef3ac25f259e2964c1ccc00c9c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 4 Apr 2018 23:59:30 +0200 Subject: [PATCH] Handle GIF and Document type --- pyrogram/client/utils.py | 46 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/utils.py b/pyrogram/client/utils.py index 283dc48f..29b7e038 100644 --- a/pyrogram/client/utils.py +++ b/pyrogram/client/utils.py @@ -143,6 +143,7 @@ def parse_message(message: types.Message, users: dict, chats: dict): video = None video_note = None sticker = None + document = None media = message.media @@ -241,7 +242,7 @@ def parse_message(message: types.Message, users: dict, chats: dict): mime_type=doc.mime_type, file_size=doc.size ) - elif types.DocumentAttributeVideo in attributes: + elif types.DocumentAttributeVideo in attributes and types.DocumentAttributeAnimated not in attributes: video_attributes = attributes[types.DocumentAttributeVideo] if video_attributes.round_message: @@ -297,6 +298,46 @@ def parse_message(message: types.Message, users: dict, chats: dict): # TODO: Emoji, set_name and mask_position file_size=doc.size, ) + elif types.DocumentAttributeAnimated in attributes: + document = pyrogram.Document( + file_id=encode( + pack( + "