mirror of
https://github.com/TDSCDMAA/AutoMihoyoBBS.git
synced 2026-06-10 14:12:31 +08:00
commit
5ee3d20195
@ -35,3 +35,7 @@ secret=
|
|||||||
[bark]
|
[bark]
|
||||||
api_url=https://api.day.app
|
api_url=https://api.day.app
|
||||||
token=ssXXX
|
token=ssXXX
|
||||||
|
|
||||||
|
[gotify]
|
||||||
|
api_url=http://xxx.xxx.cn
|
||||||
|
token=AMxxxx
|
||||||
|
|||||||
12
push.py
12
push.py
@ -144,6 +144,18 @@ def bark(status, push_message):
|
|||||||
).json()
|
).json()
|
||||||
log.info(f"推送结果:{rep.get('message')}")
|
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):
|
def push(status, push_message):
|
||||||
if not load_config():
|
if not load_config():
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user