钉钉机器人配置调整

Signed-off-by: TingHsi <rnb520@vip.qq.com>
This commit is contained in:
TingHsi 2022-05-09 00:52:11 +08:00
parent b3dc262bc7
commit dec7a6d065
3 changed files with 8 additions and 7 deletions

View File

@ -108,9 +108,9 @@
## dingrobot
钉钉群机器人
[dingrobot]中的api_url填写**Webhook**地址
**webhook**填写**Webhook**地址
[setting]中的**push_token**用于填写**安全设置**中**加签**的密钥,此选项为可选项
**secret**填写**安全设置**中**加签**的密钥,此选项为可选项
填写示例
@ -118,9 +118,9 @@
[setting]
enable=true
push_server=dingrobot
push_token=
[dingrobot]
api_url=https://oapi.dingtalk.com/robot/send?access_token=XXX
webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX
secret=
```

View File

@ -27,4 +27,5 @@ api_url=https://api2.pushdeer.com
token=
[dingrobot]
api_url=https://oapi.dingtalk.com/robot/send?access_token=XXX
webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX
secret=

View File

@ -105,8 +105,8 @@ def pushdeer(status, push_message):
# 钉钉群机器人
def dingrobot(status, push_message):
api_url = cfg.get('dingrobot', 'api_url') # https://oapi.dingtalk.com/robot/send?access_token=XXX
secret = cfg.get('setting', 'push_token') # 安全设置 -> 加签 -> 密钥
api_url = cfg.get('dingrobot', 'webhook') # https://oapi.dingtalk.com/robot/send?access_token=XXX
secret = cfg.get('dingrobot', 'secret') # 安全设置 -> 加签 -> 密钥 -> SEC*
if secret:
timestamp = str(round(time.time() * 1000))