From 2078e6da282d29320aa7336f2a5fdca8b0cb1b01 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 11 Mar 2019 21:27:25 +0100 Subject: [PATCH] Turn send_cached_media async --- pyrogram/client/methods/messages/send_cached_media.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyrogram/client/methods/messages/send_cached_media.py b/pyrogram/client/methods/messages/send_cached_media.py index 843b7197..afcde68d 100644 --- a/pyrogram/client/methods/messages/send_cached_media.py +++ b/pyrogram/client/methods/messages/send_cached_media.py @@ -27,7 +27,7 @@ from pyrogram.client.ext import BaseClient, utils class SendCachedMedia(BaseClient): - def send_cached_media( + async def send_cached_media( self, chat_id: Union[int, str], file_id: str, @@ -114,9 +114,9 @@ class SendCachedMedia(BaseClient): ) ) - r = self.send( + r = await self.send( functions.messages.SendMedia( - peer=self.resolve_peer(chat_id), + peer=await self.resolve_peer(chat_id), media=media, silent=disable_notification or None, reply_to_msg_id=reply_to_message_id, @@ -128,7 +128,7 @@ class SendCachedMedia(BaseClient): for i in r.updates: if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)): - return pyrogram.Message._parse( + return await pyrogram.Message._parse( self, i.message, {i.id: i for i in r.users}, {i.id: i for i in r.chats}