Compare commits
2 Commits
4002dec33c
...
b2e219ece5
| Author | SHA1 | Date | |
|---|---|---|---|
| b2e219ece5 | |||
| 131e440d6b |
@@ -477,20 +477,6 @@ def _handle_message(tg_cfg: TelegramConfig, cfg: Config, msg: dict):
|
|||||||
logger.info(" 上下文已丢失,清理")
|
logger.info(" 上下文已丢失,清理")
|
||||||
return
|
return
|
||||||
|
|
||||||
# 有附件但没文字:累积附件,等用户输入文字
|
|
||||||
if media and not text:
|
|
||||||
pending = conv.get("pending_attachments", [])
|
|
||||||
for att in media:
|
|
||||||
pending.append(att)
|
|
||||||
conv["pending_attachments"] = pending
|
|
||||||
save_conversation(chat_id, conv)
|
|
||||||
delete_message(tg_cfg, chat_id_str, user_msg_id)
|
|
||||||
send_text(tg_cfg, chat_id_str,
|
|
||||||
f"📎 已添加 {len(pending)} 个附件,请输入回复内容发送",
|
|
||||||
reply_markup=_cancel_keyboard())
|
|
||||||
return
|
|
||||||
|
|
||||||
# 有文字(可能也有附件):发送邮件
|
|
||||||
delete_message(tg_cfg, chat_id_str, user_msg_id)
|
delete_message(tg_cfg, chat_id_str, user_msg_id)
|
||||||
if prompt_msg_id:
|
if prompt_msg_id:
|
||||||
delete_message(tg_cfg, chat_id_str, prompt_msg_id)
|
delete_message(tg_cfg, chat_id_str, prompt_msg_id)
|
||||||
@@ -502,7 +488,7 @@ def _handle_message(tg_cfg: TelegramConfig, cfg: Config, msg: dict):
|
|||||||
_do_send_reply(tg_cfg, cfg, chat_id, conv["summary_msg_id"], ctx, text,
|
_do_send_reply(tg_cfg, cfg, chat_id, conv["summary_msg_id"], ctx, text,
|
||||||
attachments=all_attachments or None)
|
attachments=all_attachments or None)
|
||||||
attach_info = f" (+{len(all_attachments)}个附件)" if all_attachments else ""
|
attach_info = f" (+{len(all_attachments)}个附件)" if all_attachments else ""
|
||||||
send_text(tg_cfg, chat_id_str, f"✅ 回复已发送: {text}{attach_info}")
|
send_text(tg_cfg, chat_id_str, f"✅ 回复已发送{attach_info}")
|
||||||
delete_conversation(chat_id)
|
delete_conversation(chat_id)
|
||||||
logger.info(" 回复发送完成")
|
logger.info(" 回复发送完成")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user