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

Function iGot

notify.py:271–288  ·  view source on GitHub ↗

使用 iGot 推送消息。

(title: str, content: str)

Source from the content-addressed store, hash-verified

269
270
271def iGot(title: str, content: str) -> None:
272 """
273 使用 iGot 推送消息。
274 """
275 if not push_config.get("IGOT_PUSH_KEY"):
276 print("iGot 服务的 IGOT_PUSH_KEY 未设置!!\n取消推送")
277 return
278 print("iGot 服务启动")
279
280 url = f'https://push.hellyw.com/{push_config.get("IGOT_PUSH_KEY")}'
281 data = {"title": title, "content": content}
282 headers = {"Content-Type": "application/x-www-form-urlencoded"}
283 response = requests.post(url, data=data, headers=headers).json()
284
285 if response["ret"] == 0:
286 print("iGot 推送成功!")
287 else:
288 print(f'iGot 推送失败!{response["errMsg"]}')
289
290
291def serverJ(title: str, content: str) -> None:

Callers

nothing calls this directly

Calls 1

printFunction · 0.85

Tested by

no test coverage detected