From b91ba4be7405d84dc33ebe711c9f1cbbe28c8d8d Mon Sep 17 00:00:00 2001 From: yym68686 Date: Fri, 14 Jun 2024 18:46:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Bug:=20Fixed=20the=20bug=20where?= =?UTF-8?q?=20uploading=20images=20could=20not=20retrieve=20text=20error?= =?UTF-8?q?=20when=20there=20is=20NICK.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 💻 Code: Change the robot's first message back to "Thinking". --- bot.py | 5 ++++- utils/i18n.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bot.py b/bot.py index 4f411019..11548b12 100644 --- a/bot.py +++ b/bot.py @@ -99,6 +99,8 @@ async def GetMesage(update_message, context): image_url = None file_url = None reply_to_message_text = None + message = None + rawtext = None chatid = str(update_message.chat_id) message_thread_id = update_message.message_thread_id @@ -121,7 +123,8 @@ async def GetMesage(update_message, context): image_url = await get_file_url(photo, context) - message = rawtext = CutNICK(update_message.caption, update_message) + if update_message.caption: + message = rawtext = CutNICK(update_message.caption, update_message) if update_message.document: file = update_message.document diff --git a/utils/i18n.py b/utils/i18n.py index 66ecda05..7f409eee 100644 --- a/utils/i18n.py +++ b/utils/i18n.py @@ -74,16 +74,16 @@ "en": "Reply message", "zh-hk": "回覆消息", }, - "message_think": { - "zh": "`...`", - "en": "`...`", - "zh-hk": "`...`", - }, # "message_think": { - # "zh": "`思考中💭`", - # "en": "`thinking💭`", - # "zh-hk": "`思考中💭`", + # "zh": "`...`", + # "en": "`...`", + # "zh-hk": "`...`", # }, + "message_think": { + "zh": "`思考中💭`", + "en": "`thinking💭`", + "zh-hk": "`思考中💭`", + }, "message_banner": { "zh": "👇 下面可以随时更改默认模型:", "en": "👇 Change model below:",