Skip to content

Commit

Permalink
pyrofork: methods: edit_message_media: parse caption_entities field f…
Browse files Browse the repository at this point in the history
…rom InputMedia

Signed-off-by: wulan17 <wulan17@nusantararom.org>
  • Loading branch information
wulan17 committed Aug 18, 2024
1 parent ef5b208 commit aaee3bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyrogram/methods/messages/edit_message_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ async def edit_message_media(
InputMediaAudio("new_audio.mp3"))
"""
caption = media.caption
caption_entities = media.caption_entities
parse_mode = media.parse_mode

message, entities = None, None

if caption is not None:
message, entities = (await self.parser.parse(caption, parse_mode)).values()
message, entities = (await utils.parse_text_entities(self, caption, parse_mode, caption_entities)).values()

if isinstance(media, types.InputMediaPhoto):
if isinstance(media.media, io.BytesIO) or os.path.isfile(media.media):
Expand Down

0 comments on commit aaee3bc

Please sign in to comment.