MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / pushdeer

Function pushdeer

notify.py:342–364  ·  view source on GitHub ↗

通过PushDeer 推送消息

(title: str, content: str)

Source from the content-addressed store, hash-verified

340
341
342def pushdeer(title: str, content: str) -> None:
343 """
344 通过PushDeer 推送消息
345 """
346 if not push_config.get("DEER_KEY"):
347 return
348 print("PushDeer 服务启动")
349 data = {
350 "text": title,
351 "desp": content,
352 "type": "markdown",
353 "pushkey": push_config.get("DEER_KEY"),
354 }
355 url = "https://api2.pushdeer.com/message/push"
356 if push_config.get("DEER_URL"):
357 url = push_config.get("DEER_URL")
358
359 response = requests.post(url, data=data).json()
360
361 if len(response.get("content").get("result")) > 0:
362 print("PushDeer 推送成功!")
363 else:
364 print("PushDeer 推送失败!错误信息:", response)
365
366
367def chat(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