- 新增 /webhook/trendradar 接口,支持TrendRadar通用Webhook推送 - 支持 token 校验、默认目标群配置、可选payload覆盖目标群 - 将Webhook蓝图注册到Dashboard服务,并补充配置项 - 新增对接说明文档,提供TrendRadar环境变量模板示例
60 lines
1.3 KiB
Markdown
60 lines
1.3 KiB
Markdown
# TrendRadar Webhook 适配说明
|
||
|
||
## 1. 接口地址
|
||
|
||
在 ABOT 侧新增了 webhook 入口:
|
||
|
||
`POST /webhook/trendradar`
|
||
|
||
示例:
|
||
|
||
`http://<你的ABOT地址>:8888/webhook/trendradar`
|
||
|
||
## 2. ABOT 配置
|
||
|
||
编辑 [admin/dashboard/config.toml](/D:/learn/abot/admin/dashboard/config.toml):
|
||
|
||
```toml
|
||
[trendradar_webhook]
|
||
enabled = true
|
||
token = "your_secure_token"
|
||
default_group_ids = ["xxxx@chatroom"]
|
||
allow_payload_target_groups = false
|
||
send_timeout_seconds = 20
|
||
```
|
||
|
||
## 3. TrendRadar 配置(Generic Webhook)
|
||
|
||
在 TrendRadar 里设置:
|
||
|
||
1. `NOTIFICATION_PROVIDER=generic_webhook`
|
||
2. `GENERIC_WEBHOOK_URL=http://<你的ABOT地址>:8888/webhook/trendradar`
|
||
3. `GENERIC_WEBHOOK_METHOD=POST`
|
||
4. `GENERIC_WEBHOOK_HEADERS={"Content-Type":"application/json"}`
|
||
5. `GENERIC_WEBHOOK_TEMPLATE={"token":"your_secure_token","title":"{title}","content":"{content}","source":"TrendRadar"}`
|
||
|
||
## 4. 可选:让 TrendRadar 指定目标群
|
||
|
||
若你希望不同热点推送到不同群:
|
||
|
||
1. ABOT 配置 `allow_payload_target_groups = true`
|
||
2. TrendRadar 模板加目标群字段:
|
||
|
||
```json
|
||
{
|
||
"token": "your_secure_token",
|
||
"title": "{title}",
|
||
"content": "{content}",
|
||
"target_group_ids": ["xxxx@chatroom","yyyy@chatroom"]
|
||
}
|
||
```
|
||
|
||
## 5. 返回结果
|
||
|
||
接口返回 JSON,包含:
|
||
|
||
1. `success`
|
||
2. `sent_groups`
|
||
3. `failed_groups`
|
||
|