·
已选 0 条
加载中…
POST http://72.61.140.60:8089/api/incidents/log
Content-Type: application/json X-Bot-Secret: <主管理员去 VPS .env 拿 INCIDENT_BOT_SECRET>
{
"cs_user_id": "13645109",
"platform_name": "91porn(JIAHUA)",
"message": "可选:用户原始问题",
"occurred_at": "2026-05-13 18:44"
}
{"raw_text": "⚠ AI 处理失败\n产品名称: 91porn(JIAHUA)\n用户ID: 13645109\nAI 无法处理用户请求,已自动转人工…"}
import requests, os
INC_URL = "http://72.61.140.60:8089/api/incidents/log"
SECRET = os.environ["INCIDENT_BOT_SECRET"]
def forward_to_dashboard(message_text: str):
"""每次 bot 在群里发完 'AI 处理失败' 后调用一次"""
try:
requests.post(INC_URL,
headers={"X-Bot-Secret": SECRET},
json={"raw_text": message_text},
timeout=5)
except Exception as e:
print("forward failed:", e) # 不阻塞 bot 主流程
{ok:true, id:N} 即录入成功