fix: send AI suggestion as MarkdownV2 code block for copy-on-tap
This commit is contained in:
@@ -385,10 +385,13 @@ def _handle_callback(tg_cfg: TelegramConfig, cfg: Config, cb: dict):
|
||||
sel_text = sel["text"]
|
||||
logger.info(" 选择回复 #%d: %s", idx, sel_text[:60])
|
||||
|
||||
# 用代码块显示,点击可复制
|
||||
# 用代码块显示,点击可复制(MarkdownV2)
|
||||
escaped = sel_text.replace("\\", "\\\\").replace("`", "\\`")
|
||||
copy_msg = send_text(tg_cfg, str(chat_id),
|
||||
f"*建议回复(点击代码块复制):*\n`{escaped}`")
|
||||
_tg_req(tg_cfg, "sendMessage", {
|
||||
"chat_id": str(chat_id),
|
||||
"text": f"*建议回复(点击代码块复制):*\n`{escaped}`",
|
||||
"parse_mode": "MarkdownV2",
|
||||
})
|
||||
|
||||
# 进入 awaiting_reply 状态,用户可编辑后发送
|
||||
prompt_msg_id = send_text(
|
||||
|
||||
Reference in New Issue
Block a user