Skip to content

Commit

Permalink
🐛 Bug: Fix the bug where caption images cannot be recognized.
Browse files Browse the repository at this point in the history
💻 Code: Set the Docker image tag to latest
  • Loading branch information
yym68686 committed Jun 26, 2024
1 parent 1f780f9 commit a119741
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
file: Dockerfile.build
platforms: linux/amd64,linux/arm64
push: true
tags: yym68686/chatgpt:1.0
tags: yym68686/chatgpt:lastest
17 changes: 9 additions & 8 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,23 @@ async def GetMesage(update_message, context):
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)

if update_message.photo:
photo = update_message.photo[-1]

image_url = await get_file_url(photo, context)

if update_message.caption:
message = rawtext = CutNICK(update_message.caption, update_message)

if update_message.document:
file = update_message.document

file_url = await get_file_url(file, context)

message = rawtext = CutNICK(update_message.caption, update_message)

if update_message.photo:
photo = update_message.photo[-1]

image_url = await get_file_url(photo, context)
if image_url == None and file_url and (file_url[-3:] == "jpg" or file_url[-3:] == "png" or file_url[-4:] == "jpeg"):
image_url = file_url

if update_message.caption:
message = rawtext = CutNICK(update_message.caption, update_message)
message = rawtext = CutNICK(update_message.caption, update_message)

return message, rawtext, image_url, chatid, messageid, reply_to_message_text, message_thread_id, convo_id, file_url, reply_to_message_file_content

Expand Down

0 comments on commit a119741

Please sign in to comment.