MCPcopy Create free account
hub / github.com/MoMingRose/QLAutomateTasks / chat

Function chat

notify.py:339–354  ·  view source on GitHub ↗

通过Chat 推送消息

(title: str, content: str)

Source from the content-addressed store, hash-verified

337
338
339def chat(title: str, content: str) -> None:
340 """
341 通过Chat 推送消息
342 """
343 if not push_config.get("CHAT_URL") or not push_config.get("CHAT_TOKEN"):
344 print("chat 服务的 CHAT_URL或CHAT_TOKEN 未设置!!\n取消推送")
345 return
346 print("chat 服务启动")
347 data = "payload=" + json.dumps({"text": title + "\n" + content})
348 url = push_config.get("CHAT_URL") + push_config.get("CHAT_TOKEN")
349 response = requests.post(url, data=data)
350
351 if response.status_code == 200:
352 print("Chat 推送成功!")
353 else:
354 print("Chat 推送失败!错误信息:", response)
355
356
357def pushplus_bot(title: str, content: str) -> None:

Callers

nothing calls this directly

Calls 1

printFunction · 0.85

Tested by

no test coverage detected