File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
pyrogram/types/messages_and_media Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1103,19 +1103,23 @@ async def _parse(
1103
1103
)
1104
1104
1105
1105
if isinstance (action , raw .types .MessageActionPinMessage ):
1106
+ parsed_message .service = enums .MessageServiceType .PINNED_MESSAGE
1106
1107
try :
1107
1108
parsed_message .pinned_message = await client .get_replied_message (
1108
1109
chat_id = parsed_message .chat .id ,
1109
1110
message_ids = message .id ,
1110
1111
replies = 0
1111
1112
)
1112
1113
except MessageIdsEmpty :
1113
- parsed_message .pinned_message = types .Message (
1114
- id = message .reply_to .reply_to_msg_id ,
1115
- empty = True ,
1116
- client = client
1117
- )
1118
- parsed_message .service = enums .MessageServiceType .PINNED_MESSAGE
1114
+ if (
1115
+ message .reply_to and
1116
+ isinstance (message .reply_to , raw .types .InputReplyToMessage )
1117
+ ):
1118
+ parsed_message .pinned_message = types .Message (
1119
+ id = message .reply_to .reply_to_msg_id ,
1120
+ empty = True ,
1121
+ client = client
1122
+ )
1119
1123
1120
1124
if isinstance (action , raw .types .MessageActionGameScore ):
1121
1125
parsed_message .game_high_score = types .GameHighScore ._parse_action (client , message , users )
You can’t perform that action at this time.
0 commit comments