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

Function pushdeer

notify.py:313–336  ·  view source on GitHub ↗

通过PushDeer 推送消息

(title: str, content: str)

Source from the content-addressed store, hash-verified

311
312
313def pushdeer(title: str, content: str) -> None:
314 """
315 通过PushDeer 推送消息
316 """
317 if not push_config.get("DEER_KEY"):
318 print("PushDeer 服务的 DEER_KEY 未设置!!\n取消推送")
319 return
320 print("PushDeer 服务启动")
321 data = {
322 "text": title,
323 "desp": content,
324 "type": "markdown",
325 "pushkey": push_config.get("DEER_KEY"),
326 }
327 url = "https://api2.pushdeer.com/message/push"
328 if push_config.get("DEER_URL"):
329 url = push_config.get("DEER_URL")
330
331 response = requests.post(url, data=data).json()
332
333 if len(response.get("content").get("result")) > 0:
334 print("PushDeer 推送成功!")
335 else:
336 print("PushDeer 推送失败!错误信息:", response)
337
338
339def chat(title: str, content: str) -> None:

Callers

nothing calls this directly

Calls 1

printFunction · 0.85

Tested by

no test coverage detected