add server酱 turbo 版推送通道

This commit is contained in:
张小璋 2021-02-14 13:51:22 +08:00
parent 1a442630ab
commit bbe1e86bc5
9 changed files with 21 additions and 0 deletions

View File

@ -30,6 +30,7 @@ jobs:
DINGTALK_SECRET: ${{ secrets.DINGTALK_SECRET }}
DINGTALK_ACCESS_TOKEN: ${{secrets.DINGTALK_ACCESS_TOKEN}}
SCKEY: ${{secrets.SCKEY}}
SENDKEY: ${{secrets.SENDKEY}}
BARK_URL: ${{secrets.BARK_URL}}
QMSG_KEY: ${{secrets.QMSG_KEY}}
TG_BOT_TOKEN: ${{secrets.TG_BOT_TOKEN}}

View File

@ -28,6 +28,7 @@ jobs:
DINGTALK_SECRET: ${{ secrets.DINGTALK_SECRET }}
DINGTALK_ACCESS_TOKEN: ${{secrets.DINGTALK_ACCESS_TOKEN}}
SCKEY: ${{secrets.SCKEY}}
SENDKEY: ${{secrets.SENDKEY}}
BARK_URL: ${{secrets.BARK_URL}}
QMSG_KEY: ${{secrets.QMSG_KEY}}
TG_BOT_TOKEN: ${{secrets.TG_BOT_TOKEN}}

View File

@ -29,6 +29,7 @@ jobs:
DINGTALK_SECRET: ${{ secrets.DINGTALK_SECRET }}
DINGTALK_ACCESS_TOKEN: ${{secrets.DINGTALK_ACCESS_TOKEN}}
SCKEY: ${{secrets.SCKEY}}
SENDKEY: ${{secrets.SENDKEY}}
BARK_URL: ${{secrets.BARK_URL}}
QMSG_KEY: ${{secrets.QMSG_KEY}}
TG_BOT_TOKEN: ${{secrets.TG_BOT_TOKEN}}

View File

@ -2,6 +2,7 @@
"DINGTALK_SECRET": "xxxxxx",
"DINGTALK_ACCESS_TOKEN": "xxxxxx",
"SCKEY": "xxxxxx",
"SENDKEY": "xxxxxx",
"BARK_URL": "xxxxxx",
"QMSG_KEY": "xxxxxx",
"TG_BOT_TOKEN": "xxxxxx",

View File

@ -2,6 +2,7 @@
if [[ $DINGTALK_SECRET ]]; then echo "DINGTALK_SECRET 变量存在,并成功赋值" ;else DINGTALK_SECRET="";fi;
if [[ $DINGTALK_ACCESS_TOKEN ]]; then echo "DINGTALK_ACCESS_TOKEN 变量存在,并成功赋值" ;else DINGTALK_ACCESS_TOKEN=""; fi;
if [[ $SCKEY ]]; then echo "SCKEY 变量存在,并成功赋值" ;else SCKEY=""; fi;
if [[ $SENDKEY ]]; then echo "SENDKEY 变量存在,并成功赋值" ;else SENDKEY=""; fi;
if [[ $BARK_URL ]]; then echo "BARK_URL 变量存在,并成功赋值" ;else BARK_URL=""; fi;
if [[ $QMSG_KEY ]]; then echo "QMSG_KEY 变量存在,并成功赋值" ;else QMSG_KEY=""; fi;
if [[ $TG_BOT_TOKEN ]]; then echo "TG_BOT_TOKEN 变量存在,并成功赋值" ;else TG_BOT_TOKEN=""; fi;
@ -36,6 +37,7 @@ JSONSTR="{
\"DINGTALK_SECRET\": \"${DINGTALK_SECRET}\",
\"DINGTALK_ACCESS_TOKEN\": \"${DINGTALK_ACCESS_TOKEN}\",
\"SCKEY\": \"${SCKEY}\",
\"SENDKEY\": \"${SENDKEY}\",
\"BARK_URL\": \"${BARK_URL}\",
\"QMSG_KEY\": \"${QMSG_KEY}\",
\"TG_BOT_TOKEN\": \"${TG_BOT_TOKEN}\",

View File

@ -2,6 +2,7 @@
"DINGTALK_SECRET": "xxxxxx",
"DINGTALK_ACCESS_TOKEN": "xxxxxx",
"SCKEY": "xxxxxx",
"SENDKEY": "xxxxxx"
"BARK_URL": "xxxxxx",
"QMSG_KEY": "xxxxxx",
"TG_BOT_TOKEN": "xxxxxx",

View File

@ -15,6 +15,7 @@
|_**DINGTALK_SECRET**_|钉钉推送|推送|钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) 密钥,机器人安全设置页面,加签一栏下面显示的 `SEC` 开头的字符串, 注:填写了 `DD_BOT_TOKEN``DD_BOT_SECRET`,钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选|
|_**DINGTALK_ACCESS_TOKEN**_|钉钉推送|推送|钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需 `https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的 `XXX`|
|_**SCKEY**_|server 酱推送|推送|server 酱推送[官方文档](https://sc.ftqq.com/3.version) ,填写 `SCKEY` 代码即可|
|_**SENDKEY**_|server 酱 TURBO 推送|推送|server 酱 TURBO 推送[官方文档](https://sct.ftqq.com/sendkey) ,填写 `SENDKEY` 代码即可|
|_**BARK_URL**_|BARK 推送|推送|BARK 推送[使用](https://github.com/Sitoi/dailycheckin/issues/29) ,填写 `BARK_URL` 即可,例如: `https://api.day.app/DxHcxxxxxRxxxxxxcm/` |
|_**QMSG_KEY**_|qmsg 酱推送|推送|qmsg 酱推送[官方文档](https://qmsg.zendee.cn/index.html) ,填写 `KEY` 代码即可|
|_**TG_BOT_TOKEN**_|telegram 推送|推送|telegram 推送 `TG_BOT_TOKEN`|
@ -176,6 +177,7 @@
"DINGTALK_SECRET": "xxxxxx",
"DINGTALK_ACCESS_TOKEN": "xxxxxx",
"SCKEY": "xxxxxx",
"SENDKEY": "xxxxxx",
"BARK_URL": "xxxxxx",
"QMSG_KEY": "xxxxxx",
"TG_BOT_TOKEN": "xxxxxx",

View File

@ -13,6 +13,7 @@ from utils.message import (
message2dingtalk,
message2qmsg,
message2server,
message2server_turbo,
message2telegram,
)
@ -26,6 +27,7 @@ def main_handler(event, context):
dingtalk_access_token = os.getenv("DINGTALK_ACCESS_TOKEN")
bark_url = os.getenv("BARK_URL")
sckey = os.getenv("SCKEY")
sendkey = os.getenv("SENDKEY")
tg_bot_token = os.getenv("TG_BOT_TOKEN")
tg_user_id = os.getenv("TG_USER_ID")
qmsg_key = os.getenv("QMSG_KEY")
@ -47,6 +49,7 @@ def main_handler(event, context):
dingtalk_access_token = data.get("DINGTALK_ACCESS_TOKEN")
bark_url = data.get("BARK_URL")
sckey = data.get("SCKEY")
sendkey = data.get("SENDKEY")
qmsg_key = data.get("QMSG_KEY")
tg_bot_token = data.get("TG_BOT_TOKEN")
tg_user_id = data.get("TG_USER_ID")
@ -105,6 +108,9 @@ def main_handler(event, context):
)
if sckey:
message2server(sckey=sckey, content=content)
if sendkey:
message2server_turbo(sendkey=sendkey, content=content)
if qmsg_key:
for content in content_list:
message2qmsg(qmsg_key=qmsg_key, content=content)

View File

@ -15,6 +15,12 @@ def message2server(sckey, content):
requests.post(url=f"https://sc.ftqq.com/{sckey}.send", data=data)
return
def message2server_turbo(sendkey, content):
print("server 酱 Turbo 推送开始")
data = {"text": "每日签到", "desp": content.replace("\n", "\n\n")}
requests.post(url=f"https://sctapi.ftqq.com/{sendkey}.send", data=data)
return
def message2coolpush(
coolpushskey, content, coolpushqq: bool = True, coolpushwx: bool = False, coolpushemail: bool = False