pushdeer支持(测试)

This commit is contained in:
Womsxd 2022-04-20 13:44:55 +08:00
parent 2030c9d1a1
commit 7d4059ad6e
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68
2 changed files with 19 additions and 2 deletions

View File

@ -20,4 +20,8 @@ chat_id=123456
#企业微信的appid
agentid=
secret=
wechat_id=
wechat_id=
[pushdeer]
api_url=https://api2.pushdeer.com
token=

15
push.py
View File

@ -68,7 +68,7 @@ def cq_http(status, push_message):
# 企业微信 感谢linjie5492@github
def wecom(status, push_message, wx_push_token=None):
def wecom(status, push_message):
secret = cfg.get('wecom', 'secret')
wechat_id = cfg.get('wecom', 'wechat_id')
push_token = http.post(
@ -84,6 +84,19 @@ def wecom(status, push_message, wx_push_token=None):
http.post(f'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={push_token}', json=push_data)
# pushdeer
def pushdeer(status, push_message):
http.get(
url=f'{cfg.get("pushdeer", "api_url")}/message/push',
params={
"push_key": cfg.get("pushdeer", "token"),
"text": title(status),
"desp": str(push_message).replace("\r\n", "\r\n\r\n"),
"type": "markdown"
}
)
def push(status, push_message):
if not load_config():
return 0