From 2daa5932c6641f8c3d3fa2445d64a731d7b77fdd Mon Sep 17 00:00:00 2001 From: Shrimadhav U K Date: Mon, 23 Dec 2019 19:44:58 +0530 Subject: [PATCH] Add missing asyncio keywords (#319) * fix missing await * fix empty file reference * one more await, and file reference --- .../client/methods/messages/edit_message_media.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyrogram/client/methods/messages/edit_message_media.py b/pyrogram/client/methods/messages/edit_message_media.py index 579e3c44..2042a675 100644 --- a/pyrogram/client/methods/messages/edit_message_media.py +++ b/pyrogram/client/methods/messages/edit_message_media.py @@ -108,7 +108,7 @@ class EditMessageMedia(BaseClient): peer=await self.resolve_peer(chat_id), media=types.InputMediaUploadedDocument( mime_type=self.guess_mime_type(media.media) or "video/mp4", - thumb=None if media.thumb is None else self.save_file(media.thumb), + thumb=None if media.thumb is None else await self.save_file(media.thumb), file=await self.save_file(media.media), attributes=[ types.DocumentAttributeVideo( @@ -145,7 +145,7 @@ class EditMessageMedia(BaseClient): peer=await self.resolve_peer(chat_id), media=types.InputMediaUploadedDocument( mime_type=self.guess_mime_type(media.media) or "audio/mpeg", - thumb=None if media.thumb is None else self.save_file(media.thumb), + thumb=None if media.thumb is None else await self.save_file(media.thumb), file=await self.save_file(media.media), attributes=[ types.DocumentAttributeAudio( @@ -165,7 +165,7 @@ class EditMessageMedia(BaseClient): id=types.InputDocument( id=media.document.id, access_hash=media.document.access_hash, - file_reference=b"" + file_reference=media.document.file_reference ) ) elif media.media.startswith("http"): @@ -203,7 +203,7 @@ class EditMessageMedia(BaseClient): id=types.InputDocument( id=media.document.id, access_hash=media.document.access_hash, - file_reference=b"" + file_reference=media.document.file_reference ) ) elif media.media.startswith("http"): @@ -219,7 +219,7 @@ class EditMessageMedia(BaseClient): peer=await self.resolve_peer(chat_id), media=types.InputMediaUploadedDocument( mime_type=self.guess_mime_type(media.media) or "application/zip", - thumb=None if media.thumb is None else self.save_file(media.thumb), + thumb=None if media.thumb is None else await self.save_file(media.thumb), file=await self.save_file(media.media), attributes=[ types.DocumentAttributeFilename( @@ -234,7 +234,7 @@ class EditMessageMedia(BaseClient): id=types.InputDocument( id=media.document.id, access_hash=media.document.access_hash, - file_reference=b"" + file_reference=media.document.file_reference ) ) elif media.media.startswith("http"):