From 790bd5551746ca57f183e975f77c147b2492adf9 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 29 Mar 2024 23:24:44 +0800 Subject: [PATCH] Correct typo --- handlers/__init__.py | 4 ++-- handlers/gemini.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/handlers/__init__.py b/handlers/__init__.py index 43f0c04..df5732d 100644 --- a/handlers/__init__.py +++ b/handlers/__init__.py @@ -23,7 +23,7 @@ BOT_MESSAGE_LENGTH = 4000 def bot_reply_first(message: Message, who: str, bot: TeleBot) -> Message: """ Create the first reply message which make user feel the bot is working. """ return bot.reply_to(message, - f"**{who}** is __thinking__ \.\.\.", + f"**{who}** is *thinking* \.\.\.", parse_mode="MarkdownV2" ) @@ -53,7 +53,7 @@ def bot_reply_markdown(reply_id: Message, who: str, text: str, bot: TeleBot) -> for i in range(1, len(msgs)): bot.reply_to( reply_id.reply_to_message, - f"**{hint}** \[{i+1}/{len(msgs)}\]:\n{telegramify_markdown.convert(msgs[i])}", + f"**{who}** \[{i+1}/{len(msgs)}\]:\n{telegramify_markdown.convert(msgs[i])}", parse_mode="MarkdownV2", ) except Exception as e: diff --git a/handlers/gemini.py b/handlers/gemini.py index 8a89f2f..fd8b722 100644 --- a/handlers/gemini.py +++ b/handlers/gemini.py @@ -69,6 +69,7 @@ def gemini_handler(message: Message, bot: TeleBot) -> None: gemini_reply_text = player.last.text.strip() # Gemini is often using ':' in **Title** which not work in Telegram Markdown gemini_reply_text = gemini_reply_text.replace(":**", "\:**") + gemini_reply_text = gemini_reply_text.replace(": **", "\:** ") except StopCandidateException as e: match = re.search(r'content\s*{\s*parts\s*{\s*text:\s*"([^"]+)"', str(e)) if match: