mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 20:20:23 +03:00
try to get PackedChat from cache by abcs.Peer before constructing one with no access_hash
Co-authored-by: Lonami <totufals@hotmail.com>
This commit is contained in:
parent
0ae7300cda
commit
54cfb7f102
|
@ -173,6 +173,9 @@ async def resolve_to_packed(client: Client, chat: Union[ChatLike, abcs.InputPeer
|
|||
raise RuntimeError("unexpected case")
|
||||
|
||||
if isinstance(chat, abcs.Peer):
|
||||
packed = client._chat_hashes.get(peer_id(chat))
|
||||
if packed is not None:
|
||||
return packed
|
||||
if isinstance(chat, types.PeerUser):
|
||||
return PackedChat(
|
||||
ty=PackedType.USER,
|
||||
|
|
Loading…
Reference in New Issue
Block a user