mirror of
https://github.com/paul-nameless/tg
synced 2024-11-25 13:20:25 +00:00
Add block argument to get_user_full_info call
This commit is contained in:
parent
fb11dafb38
commit
d674c1d430
3 changed files with 6 additions and 5 deletions
|
@ -77,7 +77,7 @@ class Controller:
|
|||
self.chat_size = 0.5
|
||||
|
||||
@bind(msg_handler, ["u"])
|
||||
def user_innfo(self) -> None:
|
||||
def user_info(self) -> None:
|
||||
"""Show user profile"""
|
||||
msg = MsgProxy(self.model.current_msg)
|
||||
user_id = msg.sender_id
|
||||
|
|
|
@ -615,8 +615,7 @@ class UserModel:
|
|||
if user.get("full_info"):
|
||||
return user["full_info"]
|
||||
|
||||
result = self.tg.get_user_full_info(user_id)
|
||||
result.wait()
|
||||
result = self.tg.get_user_full_info(user_id, block=True)
|
||||
if result.error:
|
||||
log.warning(f"get user full info error: {result.error_info}")
|
||||
return {}
|
||||
|
|
|
@ -380,12 +380,14 @@ class Tdlib(Telegram):
|
|||
}
|
||||
return self._send_data(data)
|
||||
|
||||
def get_user_full_info(self, user_id: int) -> AsyncResult:
|
||||
def get_user_full_info(
|
||||
self, user_id: int, block: bool = False
|
||||
) -> AsyncResult:
|
||||
data = {
|
||||
"@type": "getUserFullInfo",
|
||||
"user_id": user_id,
|
||||
}
|
||||
return self._send_data(data)
|
||||
return self._send_data(data, block=block)
|
||||
|
||||
|
||||
def get_chat_type(chat: Dict[str, Any]) -> Optional[ChatType]:
|
||||
|
|
Loading…
Reference in a new issue