使用 go_cqhttp 推送消息。
(title: str, content: str)
| 257 | |
| 258 | |
| 259 | def go_cqhttp(title: str, content: str) -> None: |
| 260 | """ |
| 261 | 使用 go_cqhttp 推送消息。 |
| 262 | """ |
| 263 | if not push_config.get("GOBOT_URL") or not push_config.get("GOBOT_QQ"): |
| 264 | return |
| 265 | print("go-cqhttp 服务启动") |
| 266 | |
| 267 | url = f'{push_config.get("GOBOT_URL")}?access_token={push_config.get("GOBOT_TOKEN")}&{push_config.get("GOBOT_QQ")}&message=标题:{title}\n内容:{content}' |
| 268 | response = requests.get(url).json() |
| 269 | |
| 270 | if response["status"] == "ok": |
| 271 | print("go-cqhttp 推送成功!") |
| 272 | else: |
| 273 | print("go-cqhttp 推送失败!") |
| 274 | |
| 275 | |
| 276 | def gotify(title: str, content: str) -> None: |