Skip to content

Commit

Permalink
🐛 Bug: Fix the bug where the image cannot be retrieved as context whe…
Browse files Browse the repository at this point in the history
…n replying with a message containing an image.
  • Loading branch information
yym68686 committed Oct 26, 2024
1 parent adf2d71 commit a47080c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ async def GetMesage(update_message, context, voice=True):
if update_message.reply_to_message:
reply_to_message_text = update_message.reply_to_message.text
reply_to_message_file = update_message.reply_to_message.document

if update_message.reply_to_message.photo:
photo = update_message.reply_to_message.photo[-1]
image_url = await get_file_url(photo, context)

if reply_to_message_file:
reply_to_message_file_url = await get_file_url(reply_to_message_file, context)
reply_to_message_file_content = Document_extract(reply_to_message_file_url, reply_to_message_file_url, None)
Expand Down

0 comments on commit a47080c

Please sign in to comment.