From 3cf758433dfb5259c7460bf9e2e1caa5bc02fbaa Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 30 Mar 2020 18:35:50 +0200 Subject: [PATCH] Add missing await keywords --- pyrogram/client/methods/messages/send_dice.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pyrogram/client/methods/messages/send_dice.py b/pyrogram/client/methods/messages/send_dice.py index c5f95d4b..389b6597 100644 --- a/pyrogram/client/methods/messages/send_dice.py +++ b/pyrogram/client/methods/messages/send_dice.py @@ -24,7 +24,7 @@ from pyrogram.client.ext import BaseClient class SendDice(BaseClient): - def send_dice( + async def send_dice( self, chat_id: Union[int, str], disable_notification: bool = None, @@ -68,9 +68,9 @@ class SendDice(BaseClient): app.send_dice("pyrogramlounge") """ - r = self.send( + r = await self.send( functions.messages.SendMedia( - peer=self.resolve_peer(chat_id), + peer=await self.resolve_peer(chat_id), media=types.InputMediaDice(), silent=disable_notification or None, reply_to_msg_id=reply_to_message_id, @@ -82,11 +82,8 @@ class SendDice(BaseClient): ) for i in r.updates: - if isinstance( - i, - (types.UpdateNewMessage, types.UpdateNewChannelMessage, types.UpdateNewScheduledMessage) - ): - return pyrogram.Message._parse( + if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage, types.UpdateNewScheduledMessage)): + return await pyrogram.Message._parse( self, i.message, {i.id: i for i in r.users}, {i.id: i for i in r.chats},