feat(price_monitor): 接入统一messenger——操作推荐归档broadcast+xmpp推送
This commit is contained in:
@@ -10,6 +10,7 @@ from datetime import datetime
|
||||
|
||||
from mo_data import read_decisions
|
||||
from alert_logger import record_alert, clear_alert
|
||||
from messenger import send as messenger_send
|
||||
|
||||
# ── 温区感知 + 信号溯源(2026-08-13)──
|
||||
try:
|
||||
@@ -179,6 +180,11 @@ def push_to_xmpp(text):
|
||||
# ACTION: 破止损/重评确认的操作信号 — 直通不限速
|
||||
# INFO: 未确认的进区提示 — 聚合成摘要,30min 限 1 条
|
||||
def _push_action(category, text):
|
||||
# 统一消息处理者:操作推荐→broadcast归档+xmpp推送
|
||||
try:
|
||||
messenger_send(title=f"MoFin持仓异动", content=text, source="price_monitor.py")
|
||||
except Exception as e:
|
||||
print(f"[messenger失败] {e}", file=sys.stderr)
|
||||
try:
|
||||
from alert_helper import notify, ACTION
|
||||
notify(category, text, ACTION)
|
||||
@@ -187,6 +193,11 @@ def _push_action(category, text):
|
||||
|
||||
|
||||
def _push_digest(category, text):
|
||||
# 普通监控信息:broadcast 归档(不打扰 xmpp)
|
||||
try:
|
||||
messenger_send(title=f"MoFin价格监控", content=text, source="price_monitor.py")
|
||||
except Exception as e:
|
||||
print(f"[messenger归档失败] {e}", file=sys.stderr)
|
||||
try:
|
||||
from alert_helper import notify, INFO
|
||||
notify(category, text, INFO)
|
||||
|
||||
Reference in New Issue
Block a user