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

Function go_cqhttp

notify.py:230–245  ·  view source on GitHub ↗

使用 go_cqhttp 推送消息。

(title: str, content: str)

Source from the content-addressed store, hash-verified

228
229
230def go_cqhttp(title: str, content: str) -> None:
231 """
232 使用 go_cqhttp 推送消息。
233 """
234 if not push_config.get("GOBOT_URL") or not push_config.get("GOBOT_QQ"):
235 print("go-cqhttp 服务的 GOBOT_URL 或 GOBOT_QQ 未设置!!\n取消推送")
236 return
237 print("go-cqhttp 服务启动")
238
239 url = f'{push_config.get("GOBOT_URL")}?access_token={push_config.get("GOBOT_TOKEN")}&{push_config.get("GOBOT_QQ")}&message=标题:{title}\n内容:{content}'
240 response = requests.get(url).json()
241
242 if response["status"] == "ok":
243 print("go-cqhttp 推送成功!")
244 else:
245 print("go-cqhttp 推送失败!")
246
247
248def gotify(title: str, content: str) -> None:

Callers

nothing calls this directly

Calls 1

printFunction · 0.85

Tested by

no test coverage detected