添加推送到gotify函数

This commit is contained in:
hours 2022-08-15 20:12:08 +08:00 committed by GitHub
parent 2d84a289c8
commit 6160202339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

12
push.py
View File

@ -144,6 +144,18 @@ def bark(status, push_message):
).json()
log.info(f"推送结果:{rep.get('message')}")
# gotify
def gotify(status, push_message):
rep = http.post(
url=f'{cfg.get("gotify", "api_url")}/message?token={cfg.get("gotify", "token")}',
headers={"Content-Type": "application/json; charset=utf-8"},
json={
"title": title(status),
"message": push_message
}
).json()
log.info(f"推送结果:{rep.get('errmsg')}")
def push(status, push_message):
if not load_config():
return 0