MCPcopy
hub / github.com/smallfawn/QLScriptPublic / iGot

Function iGot

notify.py:298–314  ·  view source on GitHub ↗

使用 iGot 推送消息。

(title: str, content: str)

Source from the content-addressed store, hash-verified

296
297
298def iGot(title: str, content: str) -> None:
299 """
300 使用 iGot 推送消息。
301 """
302 if not push_config.get("IGOT_PUSH_KEY"):
303 return
304 print("iGot 服务启动")
305
306 url = f'https://push.hellyw.com/{push_config.get("IGOT_PUSH_KEY")}'
307 data = {"title": title, "content": content}
308 headers = {"Content-Type": "application/x-www-form-urlencoded"}
309 response = requests.post(url, data=data, headers=headers).json()
310
311 if response["ret"] == 0:
312 print("iGot 推送成功!")
313 else:
314 print(f'iGot 推送失败!{response["errMsg"]}')
315
316
317def serverJ(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