使用 iGot 推送消息。
(title: str, content: str)
| 296 | |
| 297 | |
| 298 | def 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 | |
| 317 | def serverJ(title: str, content: str) -> None: |