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( + "