2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

Add missing await keywords

This commit is contained in:
Dan 2020-03-30 18:35:50 +02:00
parent aa6c935d83
commit 3cf758433d

View File

@ -24,7 +24,7 @@ from pyrogram.client.ext import BaseClient
class SendDice(BaseClient): class SendDice(BaseClient):
def send_dice( async def send_dice(
self, self,
chat_id: Union[int, str], chat_id: Union[int, str],
disable_notification: bool = None, disable_notification: bool = None,
@ -68,9 +68,9 @@ class SendDice(BaseClient):
app.send_dice("pyrogramlounge") app.send_dice("pyrogramlounge")
""" """
r = self.send( r = await self.send(
functions.messages.SendMedia( functions.messages.SendMedia(
peer=self.resolve_peer(chat_id), peer=await self.resolve_peer(chat_id),
media=types.InputMediaDice(), media=types.InputMediaDice(),
silent=disable_notification or None, silent=disable_notification or None,
reply_to_msg_id=reply_to_message_id, reply_to_msg_id=reply_to_message_id,
@ -82,11 +82,8 @@ class SendDice(BaseClient):
) )
for i in r.updates: for i in r.updates:
if isinstance( if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage, types.UpdateNewScheduledMessage)):
i, return await pyrogram.Message._parse(
(types.UpdateNewMessage, types.UpdateNewChannelMessage, types.UpdateNewScheduledMessage)
):
return pyrogram.Message._parse(
self, i.message, self, i.message,
{i.id: i for i in r.users}, {i.id: i for i in r.users},
{i.id: i for i in r.chats}, {i.id: i for i in r.chats},