fix: restore links when returning to summary view _summary_keyboard was called without links param in VIEW_SUMM handler, causing extracted links to disappear after viewing original text.
This commit is contained in:
@@ -326,10 +326,12 @@ def _handle_callback(tg_cfg: TelegramConfig, cfg: Config, cb: dict):
|
|||||||
|
|
||||||
elif action == CALLBACK_VIEW_SUMM and ctx:
|
elif action == CALLBACK_VIEW_SUMM and ctx:
|
||||||
can_reply = ctx.get("can_reply", True)
|
can_reply = ctx.get("can_reply", True)
|
||||||
|
is_promotion = ctx.get("summary_data", {}).get("category") == "promotion"
|
||||||
|
links = ctx.get("summary_data", {}).get("links", [])
|
||||||
_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": ctx["summary_text"], "parse_mode": "MarkdownV2",
|
"text": ctx["summary_text"], "parse_mode": "MarkdownV2",
|
||||||
"reply_markup": _summary_keyboard(can_reply),
|
"reply_markup": _summary_keyboard(can_reply, is_promotion, links),
|
||||||
})
|
})
|
||||||
logger.info(" 切换回摘要视图")
|
logger.info(" 切换回摘要视图")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user