使用 iGot 推送消息。
(title: str, content: str)
| 269 | |
| 270 | |
| 271 | def 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 | |
| 291 | def serverJ(title: str, content: str) -> None: |