hack the Gemini markdown formst 2

This commit is contained in:
Yi Zhao 2024-03-29 23:42:54 +08:00
parent da079d795d
commit 4a40cf7695

View File

@ -69,7 +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("**", "**")
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: