File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
pyrogram/types/messages_and_media Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -666,14 +666,15 @@ async def _parse(
666666
667667 if isinstance (message , raw .types .MessageEmpty ):
668668 sender_chat = None
669- if isinstance (message .peer_id , raw .types .PeerUser ):
670- sender_chat = types .Chat ._parse_user_chat (client , users [peer_id ])
669+ if peer_id :
670+ if isinstance (message .peer_id , raw .types .PeerUser ):
671+ sender_chat = types .Chat ._parse_user_chat (client , users [peer_id ])
671672
672- elif isinstance (message .peer_id , raw .types .PeerChat ):
673- sender_chat = types .Chat ._parse_chat_chat (client , chats [peer_id ])
673+ elif isinstance (message .peer_id , raw .types .PeerChat ):
674+ sender_chat = types .Chat ._parse_chat_chat (client , chats [peer_id ])
674675
675- else :
676- sender_chat = types .Chat ._parse_channel_chat (client , chats [peer_id ])
676+ else :
677+ sender_chat = types .Chat ._parse_channel_chat (client , chats [peer_id ])
677678
678679 return Message (
679680 id = message .id ,
You can’t perform that action at this time.
0 commit comments