From ec258312dd5af2958d845adf202060493f0638d8 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 3 May 2019 22:47:51 +0200 Subject: [PATCH] Add missing awaits --- pyrogram/client/methods/chats/update_chat_username.py | 6 +++--- pyrogram/client/methods/users/update_username.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyrogram/client/methods/chats/update_chat_username.py b/pyrogram/client/methods/chats/update_chat_username.py index 39cdfaeb..12f5fe12 100644 --- a/pyrogram/client/methods/chats/update_chat_username.py +++ b/pyrogram/client/methods/chats/update_chat_username.py @@ -23,7 +23,7 @@ from ...ext import BaseClient class UpdateChatUsername(BaseClient): - def update_chat_username( + async def update_chat_username( self, chat_id: Union[int, str], username: Union[str, None] @@ -46,11 +46,11 @@ class UpdateChatUsername(BaseClient): ``ValueError`` if a chat_id belongs to a user or chat. """ - peer = self.resolve_peer(chat_id) + peer = await self.resolve_peer(chat_id) if isinstance(peer, types.InputPeerChannel): return bool( - self.send( + await self.send( functions.channels.UpdateUsername( channel=peer, username=username or "" diff --git a/pyrogram/client/methods/users/update_username.py b/pyrogram/client/methods/users/update_username.py index d0c87eb2..15877992 100644 --- a/pyrogram/client/methods/users/update_username.py +++ b/pyrogram/client/methods/users/update_username.py @@ -23,7 +23,7 @@ from ...ext import BaseClient class UpdateUsername(BaseClient): - def update_username( + async def update_username( self, username: Union[str, None] ) -> bool: @@ -45,7 +45,7 @@ class UpdateUsername(BaseClient): """ return bool( - self.send( + await self.send( functions.account.UpdateUsername( username=username or "" )