mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-07-10 23:21:23 +08:00
feat(agent): 优化每日简报推送链路,底部追加 [一键唤醒控制台] 交互式内联按钮
This commit is contained in:
@@ -200,11 +200,24 @@ else
|
|||||||
💡 *哨兵正在后台默默守护您的资产。*"
|
💡 *哨兵正在后台默默守护您的资产。*"
|
||||||
fi
|
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}" \
|
RESPONSE=$(curl -s -m 10 -X POST "${TG_API_URL}" \
|
||||||
-d "chat_id=${CHAT_ID}" \
|
-H "Content-Type: application/json" \
|
||||||
-d "text=${MSG}" \
|
-d "$JSON_PAYLOAD")
|
||||||
-d "parse_mode=Markdown")
|
|
||||||
|
|
||||||
if [[ "$RESPONSE" != *"\"ok\":true"* ]]; then
|
if [[ "$RESPONSE" != *"\"ok\":true"* ]]; then
|
||||||
echo "❌ 战报发送失败!API 响应: $RESPONSE" >> "${INSTALL_DIR}/logs/error.log"
|
echo "❌ 战报发送失败!API 响应: $RESPONSE" >> "${INSTALL_DIR}/logs/error.log"
|
||||||
|
|||||||
Reference in New Issue
Block a user