mirror of
https://github.com/TDSCDMAA/AutoMihoyoBBS.git
synced 2026-06-06 12:23:06 +08:00
pushdeer支持(测试)
This commit is contained in:
parent
2030c9d1a1
commit
7d4059ad6e
@ -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
15
push.py
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user