refactor(config): make config.Channel to multiple instance support

add new field type to Channel struct
config.channels refactor to channel_list
update config version to 3
update the docs
This commit is contained in:
Cytown
2026-04-12 00:57:26 +08:00
parent 2b2bc26f8e
commit 667fc85d54
185 changed files with 6390 additions and 4181 deletions
+31 -17
View File
@@ -44,9 +44,10 @@ PicoClaw 支持多种聊天平台,使您的 Agent 能够连接到任何地方
```json
{
"channels": {
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
@@ -102,9 +103,10 @@ Telegram 侧保留的是命令菜单注册能力;通用命令的实际执行
```json
{
"channels": {
"channel_list": {
"discord": {
"enabled": true,
"type": "discord",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
@@ -125,7 +127,7 @@ Telegram 侧保留的是命令菜单注册能力;通用命令的实际执行
```json
{
"channels": {
"channel_list": {
"discord": {
"group_trigger": { "mention_only": true }
}
@@ -137,7 +139,7 @@ Telegram 侧保留的是命令菜单注册能力;通用命令的实际执行
```json
{
"channels": {
"channel_list": {
"discord": {
"group_trigger": { "prefixes": ["!bot"] }
}
@@ -166,9 +168,10 @@ PicoClaw 支持两种 WhatsApp 连接方式:
```json
{
"channels": {
"channel_list": {
"whatsapp": {
"enabled": true,
"type": "whatsapp",
"use_native": true,
"session_store_path": "",
"allow_from": []
@@ -200,9 +203,10 @@ picoclaw auth weixin
(可选)在 `allow_from` 中填入你的微信用户 ID,限制可以与机器人对话的用户:
```json
{
"channels": {
"channel_list": {
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
@@ -230,9 +234,10 @@ picoclaw gateway
```json
{
"channels": {
"channel_list": {
"matrix": {
"enabled": true,
"type": "matrix",
"homeserver": "https://matrix.org",
"user_id": "@your-bot:matrix.org",
"access_token": "YOUR_MATRIX_ACCESS_TOKEN",
@@ -266,9 +271,10 @@ QQ 开放平台提供了一键创建 OpenClaw 兼容机器人的页面:
```json
{
"channels": {
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
@@ -309,9 +315,10 @@ QQ 开放平台提供了一键创建 OpenClaw 兼容机器人的页面:
```json
{
"channels": {
"channel_list": {
"slack": {
"enabled": true,
"type": "slack",
"bot_token": "xoxb-YOUR-BOT-TOKEN",
"app_token": "xapp-YOUR-APP-TOKEN",
"allow_from": []
@@ -336,9 +343,10 @@ picoclaw gateway
```json
{
"channels": {
"channel_list": {
"irc": {
"enabled": true,
"type": "irc",
"server": "irc.libera.chat:6697",
"tls": true,
"nick": "picoclaw-bot",
@@ -376,9 +384,10 @@ Bot 将连接到 IRC 服务器并加入指定的频道。
```json
{
"channels": {
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
@@ -411,9 +420,10 @@ picoclaw gateway
```json
{
"channels": {
"channel_list": {
"line": {
"enabled": true,
"type": "line",
"channel_secret": "YOUR_CHANNEL_SECRET",
"channel_access_token": "YOUR_CHANNEL_ACCESS_TOKEN",
"webhook_path": "/webhook/line",
@@ -463,9 +473,10 @@ PicoClaw 通过 WebSocket/SDK 模式连接飞书 — 无需公网 Webhook URL
```json
{
"channels": {
"channel_list": {
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
@@ -511,9 +522,10 @@ picoclaw auth wecom
```json
{
"channels": {
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"bot_id": "YOUR_BOT_ID",
"secret": "YOUR_SECRET",
"websocket_url": "wss://openws.work.weixin.qq.com",
@@ -549,9 +561,10 @@ OneBot 是 QQ 机器人的开放协议。PicoClaw 通过 WebSocket 连接任何
```json
{
"channels": {
"channel_list": {
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://127.0.0.1:8080",
"access_token": "",
"allow_from": []
@@ -582,9 +595,10 @@ picoclaw gateway
```json
{
"channels": {
"channel_list": {
"maixcam": {
"enabled": true
"enabled": true,
"type": "maixcam"
}
}
}
+2 -1
View File
@@ -622,9 +622,10 @@ PicoClaw 按协议族路由提供商:
"api_key": "gsk_xxx"
}
},
"channels": {
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "123456:ABC...",
"allow_from": ["123456789"]
}
+7 -2
View File
@@ -360,7 +360,7 @@ PicoClaw 在发送请求前仅去除外层 `litellm/` 前缀,因此 `litellm/l
```json
{
"version": 2,
"version": 3,
"model_list": [
{
"model_name": "glm-4.7",
@@ -450,19 +450,22 @@ picoclaw agent -m "你好"
"model_name": "voice-gemini",
"echo_transcription": false
},
"channels": {
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "123456:ABC...",
"allow_from": ["123456789"]
},
"discord": {
"enabled": true,
"type": "discord",
"token": "",
"allow_from": [""]
},
"whatsapp": {
"enabled": false,
"type": "whatsapp",
"bridge_url": "ws://localhost:3001",
"use_native": false,
"session_store_path": "",
@@ -470,6 +473,7 @@ picoclaw agent -m "你好"
},
"feishu": {
"enabled": false,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
@@ -478,6 +482,7 @@ picoclaw agent -m "你好"
},
"qq": {
"enabled": false,
"type": "qq",
"app_id": "",
"app_secret": "",
"allow_from": []
+1
View File
@@ -372,6 +372,7 @@ LLM 不会加载所有工具,而是获得一个轻量级搜索工具(使用
},
"slack": {
"enabled": true,
"type": "slack",
"command": "npx",
"args": [
"-y",