commit
04e1f8e619
3
.gitignore
vendored
3
.gitignore
vendored
@ -138,4 +138,5 @@ dmypy.json
|
||||
config/*.json
|
||||
|
||||
# push配置
|
||||
config/push.ini
|
||||
config/push.ini
|
||||
.DS_Store
|
||||
|
@ -102,7 +102,7 @@
|
||||
|
||||
# push.ini配置教程
|
||||
|
||||
* push_server 可选范围 cqhttp ftqq(sever酱) pushplus telegram dingrobot
|
||||
* push_server 可选范围 cqhttp ftqq(sever酱) pushplus telegram dingrobot bark
|
||||
|
||||
|
||||
## Wecom
|
||||
@ -150,3 +150,29 @@ webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX
|
||||
secret=
|
||||
```
|
||||
|
||||
|
||||
|
||||
## bark
|
||||
|
||||
一款开源的消息推送工具 https://github.com/Finb/Bark
|
||||
|
||||
手机安装bark客户端获得托管在api.day.app的Token,也可以自己搭建私有服务端。
|
||||
|
||||
**api_url**一般不用改,自己搭建私有服务端的需要改掉
|
||||
|
||||
**token**填写**APP**内**URL**中的密钥,此选项必填
|
||||
|
||||
> `https://api.day.app/` `token部分` `/Title/NotificationContent`
|
||||
|
||||
填写示例
|
||||
|
||||
```ini
|
||||
[setting]
|
||||
enable=true
|
||||
push_server=bark
|
||||
|
||||
[bark]
|
||||
api_url=https://api.day.app
|
||||
token=XXX
|
||||
```
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[setting]
|
||||
enable=false
|
||||
#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot
|
||||
#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot bark
|
||||
push_server=cqhttp
|
||||
#server酱 pushplus dingrobot 的推送token
|
||||
push_token=123456
|
||||
|
5
push.py
5
push.py
@ -139,9 +139,10 @@ def dingrobot(status, push_message):
|
||||
|
||||
# Bark
|
||||
def bark(status, push_message):
|
||||
http.get(
|
||||
rep = http.get(
|
||||
url=f'{cfg.get("bark", "api_url")}/{cfg.get("bark", "token")}/{title(status)}/{push_message}'
|
||||
)
|
||||
).json()
|
||||
log.info(f"推送结果:{rep.get('message')}")
|
||||
|
||||
def push(status, push_message):
|
||||
if not load_config():
|
||||
|
Loading…
Reference in New Issue
Block a user