feat(agent): 优化每日简报推送链路,底部追加 [一键唤醒控制台] 交互式内联按钮

This commit is contained in:
hotyue
2026-04-25 05:48:53 +00:00
parent fa8eada97b
commit 2dea6e382b

View File

@@ -200,11 +200,24 @@ else
💡 *哨兵正在后台默默守护您的资产。*"
fi
# 5. 调用 API 推送 (接入安全网关)
# 5. 调用 API 推送 (接入安全网关,挂载交互式控制台按钮)
JSON_PAYLOAD=$(jq -n \
--arg cid "$CHAT_ID" \
--arg txt "$MSG" \
--arg cb "manage:${NODE_NAME}" \
'{
chat_id: $cid,
text: $txt,
parse_mode: "Markdown",
disable_web_page_preview: true,
reply_markup: {
inline_keyboard: [[{text: "⚙️ 调出该节点控制台", callback_data: $cb}]]
}
}')
RESPONSE=$(curl -s -m 10 -X POST "${TG_API_URL}" \
-d "chat_id=${CHAT_ID}" \
-d "text=${MSG}" \
-d "parse_mode=Markdown")
-H "Content-Type: application/json" \
-d "$JSON_PAYLOAD")
if [[ "$RESPONSE" != *"\"ok\":true"* ]]; then
echo "❌ 战报发送失败API 响应: $RESPONSE" >> "${INSTALL_DIR}/logs/error.log"