pyrofork: types: Chat: _parse_dialog: Handle InputPeerUser and InputPeerChat
Some checks failed
Build-docs / build (push) Has been cancelled
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled

Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
wulan17 2025-07-10 19:33:37 +07:00
parent 9258173570
commit 59869c7404
No known key found for this signature in database
GPG key ID: 737814D4B5FF0420

View file

@ -476,9 +476,9 @@ class Chat(Object):
users: Dict[int, "raw.types.User"],
chats: Dict[int, "raw.types.Chat"]
) -> "Chat":
if isinstance(peer, raw.types.PeerUser):
if isinstance(peer, raw.types.PeerUser) or isinstance(peer, raw.types.InputPeerUser):
return Chat._parse_user_chat(client, users[peer.user_id])
elif isinstance(peer, raw.types.PeerChat):
elif isinstance(peer, raw.types.PeerChat) or isinstance(peer, raw.types.InputPeerChat):
return Chat._parse_chat_chat(client, chats[peer.chat_id])
else:
return Chat._parse_channel_chat(client, chats[peer.channel_id])