File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
pyrogram/types/messages_and_media Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -644,17 +644,29 @@ async def _parse(
644
644
business_connection_id : str = None ,
645
645
raw_reply_to_message : raw .base .Message = None
646
646
):
647
+ peer_id = utils .get_raw_peer_id (message .peer_id )
648
+
647
649
if isinstance (message , raw .types .MessageEmpty ):
650
+ sender_chat = None
651
+ if isinstance (message .peer_id , raw .types .PeerUser ):
652
+ sender_chat = types .Chat ._parse_user_chat (client , users [peer_id ])
653
+
654
+ elif isinstance (message .peer_id , raw .types .PeerChat ):
655
+ sender_chat = types .Chat ._parse_chat_chat (client , chats [peer_id ])
656
+
657
+ else :
658
+ sender_chat = types .Chat ._parse_channel_chat (client , chats [peer_id ])
659
+
648
660
return Message (
649
661
id = message .id ,
650
662
empty = True ,
663
+ chat = sender_chat ,
651
664
business_connection_id = business_connection_id if business_connection_id else None ,
652
665
client = client ,
653
666
_raw = message
654
667
)
655
668
656
669
from_id = utils .get_raw_peer_id (message .from_id )
657
- peer_id = utils .get_raw_peer_id (message .peer_id )
658
670
user_id = from_id or peer_id
659
671
660
672
if isinstance (message .from_id , raw .types .PeerUser ) and isinstance (message .peer_id , raw .types .PeerUser ):
@@ -1372,6 +1384,7 @@ async def _parse(
1372
1384
@property
1373
1385
def link (self ) -> str :
1374
1386
if (
1387
+ self .chat and
1375
1388
self .chat .type in {
1376
1389
enums .ChatType .SUPERGROUP ,
1377
1390
enums .ChatType .CHANNEL
You can’t perform that action at this time.
0 commit comments