mirror of
https://github.com/TDSCDMAA/AutoMihoyoBBS.git
synced 2026-06-02 18:43:42 +08:00
Merge branch 'master' of https://github.com/Womsxd/AutoMihoyoBBS
This commit is contained in:
commit
7061102879
@ -1,9 +1,9 @@
|
||||
[setting]
|
||||
enable=true
|
||||
#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot bark pushdeer gotify smtp(邮件推送)
|
||||
push_server=cqhttp
|
||||
#server酱 pushplus dingrobot 的推送token
|
||||
push_token=123456
|
||||
# 共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot feishubot bark pushdeer gotify smtp(邮件推送)
|
||||
push_server=pushplus
|
||||
# server酱 pushplus dingrobot 的推送token
|
||||
push_token=XXXXXX
|
||||
|
||||
[cqhttp]
|
||||
#cqhttp的服务端地址
|
||||
@ -32,6 +32,9 @@ token=
|
||||
webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX
|
||||
secret=
|
||||
|
||||
[feishubot]
|
||||
webhook=https://open.feishu.cn/open-apis/bot/v2/hook/XXX
|
||||
|
||||
[bark]
|
||||
api_url=https://api.day.app
|
||||
token=ssXXX
|
||||
|
||||
11
push.py
11
push.py
@ -170,6 +170,17 @@ def dingrobot(send_title, push_message):
|
||||
).json()
|
||||
log.info(f"推送结果:{rep.get('errmsg')}")
|
||||
|
||||
# 飞书机器人
|
||||
def feishubot(send_title, push_message):
|
||||
api_url = cfg.get('feishubot', 'webhook') # https://open.feishu.cn/open-apis/bot/v2/hook/XXX
|
||||
rep = http.post(
|
||||
url=api_url,
|
||||
headers={"Content-Type": "application/json; charset=utf-8"},
|
||||
json={
|
||||
"msg_type": "text", "content": {"text": send_title + "\r\n" + push_message}
|
||||
}
|
||||
).json()
|
||||
log.info(f"推送结果:{rep.get('msg')}")
|
||||
|
||||
# Bark
|
||||
def bark(send_title, push_message):
|
||||
|
||||
14
start.bash
14
start.bash
@ -1,6 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 输出日志路径
|
||||
stdout_path=$(cd `dirname $0`;pwd)/stdout.log
|
||||
# 1-1200秒随机延时
|
||||
# 随机值$RANDOM值为1~32767
|
||||
delay=$[$RANDOM%1200];
|
||||
|
||||
# 进入脚本所在目录
|
||||
cd $(cd `dirname $0`;pwd)
|
||||
# 随机延时$RANDOM值为1~32767
|
||||
sleep $[$RANDOM%1200];
|
||||
python ./main.py;
|
||||
|
||||
echo "$(date) $[$delay/60]分钟后开始执行" > $stdout_path;
|
||||
sleep $delay;
|
||||
python3 main.py >> $stdout_path;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user