mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-17 21:22:40 +00:00
Add missing awaits
This commit is contained in:
parent
f3d7cea700
commit
ec258312dd
@ -23,7 +23,7 @@ from ...ext import BaseClient
|
|||||||
|
|
||||||
|
|
||||||
class UpdateChatUsername(BaseClient):
|
class UpdateChatUsername(BaseClient):
|
||||||
def update_chat_username(
|
async def update_chat_username(
|
||||||
self,
|
self,
|
||||||
chat_id: Union[int, str],
|
chat_id: Union[int, str],
|
||||||
username: Union[str, None]
|
username: Union[str, None]
|
||||||
@ -46,11 +46,11 @@ class UpdateChatUsername(BaseClient):
|
|||||||
``ValueError`` if a chat_id belongs to a user or chat.
|
``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):
|
if isinstance(peer, types.InputPeerChannel):
|
||||||
return bool(
|
return bool(
|
||||||
self.send(
|
await self.send(
|
||||||
functions.channels.UpdateUsername(
|
functions.channels.UpdateUsername(
|
||||||
channel=peer,
|
channel=peer,
|
||||||
username=username or ""
|
username=username or ""
|
||||||
|
@ -23,7 +23,7 @@ from ...ext import BaseClient
|
|||||||
|
|
||||||
|
|
||||||
class UpdateUsername(BaseClient):
|
class UpdateUsername(BaseClient):
|
||||||
def update_username(
|
async def update_username(
|
||||||
self,
|
self,
|
||||||
username: Union[str, None]
|
username: Union[str, None]
|
||||||
) -> bool:
|
) -> bool:
|
||||||
@ -45,7 +45,7 @@ class UpdateUsername(BaseClient):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
return bool(
|
return bool(
|
||||||
self.send(
|
await self.send(
|
||||||
functions.account.UpdateUsername(
|
functions.account.UpdateUsername(
|
||||||
username=username or ""
|
username=username or ""
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user