fix: parse_mode always MarkdownV2, add MEMORY.md with project rules

This commit is contained in:
2026-07-17 18:36:53 +08:00
parent 0abb7de5d3
commit fe24a07d15
2 changed files with 7 additions and 2 deletions

5
MEMORY.md Normal file
View File

@@ -0,0 +1,5 @@
# AI Mail Bot - 记忆
## 固定规则
- **Telegram parse_mode 永远为 MarkdownV2**,不传 None。需要发纯文本时用 Markdown 转义包装,而不是去掉 parse_mode。

View File

@@ -367,7 +367,7 @@ def _handle_callback(tg_cfg: TelegramConfig, cfg: Config, cb: dict):
# AI 处理中 # AI 处理中
_tg_req(tg_cfg, "editMessageText", { _tg_req(tg_cfg, "editMessageText", {
"chat_id": chat_id, "message_id": msg_id, "chat_id": chat_id, "message_id": msg_id,
"text": "🤖 AI思考中...", "text": "🤖 *AI思考中…*", "parse_mode": "MarkdownV2",
}) })
# 丢到 AI 线程池处理,不阻塞按钮轮询 # 丢到 AI 线程池处理,不阻塞按钮轮询
_ai_pool.submit(_do_regen, cfg, chat_id, msg_id, ctx, conv) _ai_pool.submit(_do_regen, cfg, chat_id, msg_id, ctx, conv)
@@ -400,7 +400,7 @@ def _handle_callback(tg_cfg: TelegramConfig, cfg: Config, cb: dict):
elif action == CALLBACK_PROMO_DETAIL and ctx: elif action == CALLBACK_PROMO_DETAIL and ctx:
_tg_req(tg_cfg, "editMessageText", { _tg_req(tg_cfg, "editMessageText", {
"chat_id": chat_id, "message_id": msg_id, "chat_id": chat_id, "message_id": msg_id,
"text": "🤖 AI思考中...", "parse_mode": None, "text": "🤖 *AI思考中…*", "parse_mode": "MarkdownV2",
}) })
try: try:
details = expand_promo_detail( details = expand_promo_detail(