MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / chat

Function chat

daily/notify.py:367–381  ·  view source on GitHub ↗

通过Chat 推送消息

(title: str, content: str)

Source from the content-addressed store, hash-verified

365
366
367def chat(title: str, content: str) -> None:
368 """
369 通过Chat 推送消息
370 """
371 if not push_config.get("CHAT_URL") or not push_config.get("CHAT_TOKEN"):
372 return
373 print("chat 服务启动")
374 data = "payload=" + json.dumps({"text": title + "\n" + content})
375 url = push_config.get("CHAT_URL") + push_config.get("CHAT_TOKEN")
376 response = requests.post(url, data=data)
377
378 if response.status_code == 200:
379 print("Chat 推送成功!")
380 else:
381 print("Chat 推送失败!错误信息:", response)
382
383
384def pushplus_bot(title: str, content: str) -> None:

Callers

nothing calls this directly

Calls 3

printFunction · 0.70
getMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected