mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Fix broken Chat parsing for user/bot chats
This commit is contained in:
parent
e850530a9b
commit
6027ee867f
1 changed files with 1 additions and 8 deletions
|
|
@ -225,14 +225,7 @@ class Chat(Object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(client, message: raw.types.Message or raw.types.MessageService, users: dict, chats: dict) -> "Chat":
|
def _parse(client, message: raw.types.Message or raw.types.MessageService, users: dict, chats: dict) -> "Chat":
|
||||||
if isinstance(message.peer_id, raw.types.PeerUser):
|
if isinstance(message.peer_id, raw.types.PeerUser):
|
||||||
return Chat._parse_user_chat(
|
return Chat._parse_user_chat(client, users[message.peer_id.user_id])
|
||||||
client,
|
|
||||||
users[
|
|
||||||
message.peer_id.user_id
|
|
||||||
if message.out
|
|
||||||
else utils.get_raw_peer_id(message.from_id)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
if isinstance(message.peer_id, raw.types.PeerChat):
|
if isinstance(message.peer_id, raw.types.PeerChat):
|
||||||
return Chat._parse_chat_chat(client, chats[message.peer_id.chat_id])
|
return Chat._parse_chat_chat(client, chats[message.peer_id.chat_id])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue