Merge pull request #3 from Womsxd/master

Merge
This commit is contained in:
TingHsi 2022-05-09 12:21:51 +08:00 committed by GitHub
commit abc05437ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -31,3 +31,7 @@ token=
[dingrobot] [dingrobot]
webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX
secret= secret=
[bark]
api_url=https://api.day.app
token=ssXXX

View File

@ -137,6 +137,12 @@ def dingrobot(status, push_message):
).json() ).json()
log.info(f"推送结果:{rep.get('errmsg')}") log.info(f"推送结果:{rep.get('errmsg')}")
# Bark
def bark(status, push_message):
http.get(
url=f'{cfg.get("bark", "api_url")}/{cfg.get("bark", "token")}/{title(status)}/{push_message}'
)
def push(status, push_message): def push(status, push_message):
if not load_config(): if not load_config():
return 0 return 0