diff --git a/app.log b/app.log deleted file mode 100644 index e69de29..0000000 diff --git a/src/summarizer.py b/src/summarizer.py index 1d91753..e84982f 100644 --- a/src/summarizer.py +++ b/src/summarizer.py @@ -25,12 +25,12 @@ def ai_process(cfg: Config, acct_idx: int, mail: Email, tg_msg_id: int = 0) -> O logger.info(f" 正在摘要: {mail.subject}") # 阶段1:显示等待处理 if tg_msg_id: - edit_message(cfg.telegram, cfg.telegram.chat_id, tg_msg_id, "⏳ 等待处理...") + edit_message(cfg.telegram, cfg.telegram.chat_id, tg_msg_id, "⏳ 等待处理...", parse_mode=None) else: tg_msg_id = send_thinking(cfg.telegram, cfg.telegram.chat_id, "⏳ 等待处理...") # 阶段2:AI 处理,更新为思考中 - edit_message(cfg.telegram, cfg.telegram.chat_id, tg_msg_id, "🤖 AI思考中...") + edit_message(cfg.telegram, cfg.telegram.chat_id, tg_msg_id, "🤖 AI思考中...", parse_mode=None) summary = summarize_email(cfg.ai, mail.recipient, mail.subject, mail.sender, mail.body, mail.account_email) summary["recipient"] = mail.recipient if "@" not in summary.get("sender", ""): diff --git a/src/tg_bot.py b/src/tg_bot.py index c871207..fc058d3 100644 --- a/src/tg_bot.py +++ b/src/tg_bot.py @@ -66,10 +66,10 @@ def send_thinking(tg_cfg: TelegramConfig, chat_id: str, text: str = "💭 思考 def edit_message(tg_cfg: TelegramConfig, chat_id: str, msg_id: int, - text: str, reply_markup: dict = None): + text: str, reply_markup: dict = None, parse_mode: str = "MarkdownV2"): payload = { "chat_id": chat_id, "message_id": msg_id, - "text": text, "parse_mode": "MarkdownV2", + "text": text, "parse_mode": parse_mode, } if reply_markup: payload["reply_markup"] = reply_markup