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
+36 -21
View File
@@ -40,9 +40,10 @@ Trò chuyện với picoclaw của bạn qua Telegram, Discord, WhatsApp, Matrix
```json
{
"channels": {
"channel_list": {
"telegram": {
"enabled": true,
"type": "telegram",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
@@ -90,9 +91,10 @@ Nếu đăng ký lệnh thất bại (lỗi tạm thời mạng/API), kênh vẫ
```json
{
"channels": {
"channel_list": {
"discord": {
"enabled": true,
"type": "discord",
"token": "YOUR_BOT_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
@@ -113,7 +115,7 @@ Mặc định bot phản hồi tất cả tin nhắn trong kênh server. Để g
```json
{
"channels": {
"channel_list": {
"discord": {
"group_trigger": { "mention_only": true }
}
@@ -125,7 +127,7 @@ Bạn cũng có thể kích hoạt bằng tiền tố từ khóa (ví dụ: `!bo
```json
{
"channels": {
"channel_list": {
"discord": {
"group_trigger": { "prefixes": ["!bot"] }
}
@@ -154,9 +156,10 @@ PicoClaw có thể kết nối WhatsApp theo hai cách:
```json
{
"channels": {
"channel_list": {
"whatsapp": {
"enabled": true,
"type": "whatsapp",
"use_native": true,
"session_store_path": "",
"allow_from": []
@@ -188,9 +191,10 @@ Quét mã QR được in ra bằng ứng dụng WeChat trên điện thoại. Sa
(Tùy chọn) Thêm ID người dùng WeChat vào `allow_from` để giới hạn ai có thể nhắn tin với bot:
```json
{
"channels": {
"channel_list": {
"weixin": {
"enabled": true,
"type": "weixin",
"token": "YOUR_TOKEN",
"allow_from": ["YOUR_USER_ID"]
}
@@ -219,9 +223,10 @@ QQ Open Platform cung cấp trang thiết lập một chạm cho bot tương th
```json
{
"channels": {
"channel_list": {
"qq": {
"enabled": true,
"type": "qq",
"app_id": "YOUR_APP_ID",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
@@ -261,9 +266,10 @@ Nếu bạn muốn tạo bot thủ công:
```json
{
"channels": {
"channel_list": {
"dingtalk": {
"enabled": true,
"type": "dingtalk",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": []
@@ -290,9 +296,10 @@ Kênh tích hợp được thiết kế đặc biệt cho phần cứng camera A
```json
{
"channels": {
"channel_list": {
"maixcam": {
"enabled": true
"enabled": true,
"type": "maixcam"
}
}
}
@@ -318,9 +325,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",
@@ -354,9 +362,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",
@@ -412,9 +421,10 @@ Xem [Hướng Dẫn Cấu Hình WeCom AI Bot](../channels/wecom/wecom_aibot/READ
```json
{
"channels": {
"channel_list": {
"wecom": {
"enabled": true,
"type": "wecom",
"token": "YOUR_TOKEN",
"encoding_aes_key": "YOUR_ENCODING_AES_KEY",
"webhook_url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY",
@@ -445,7 +455,7 @@ Xem [Hướng Dẫn Cấu Hình WeCom AI Bot](../channels/wecom/wecom_aibot/READ
```json
{
"channels": {
"channel_list": {
"wecom_app": {
"enabled": true,
"corp_id": "wwxxxxxxxxxxxxxxxx",
@@ -480,7 +490,7 @@ picoclaw gateway
```json
{
"channels": {
"channel_list": {
"wecom_aibot": {
"enabled": true,
"token": "YOUR_TOKEN",
@@ -521,9 +531,10 @@ PicoClaw kết nối với Feishu qua chế độ WebSocket/SDK — không cần
```json
{
"channels": {
"channel_list": {
"feishu": {
"enabled": true,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "YOUR_APP_SECRET",
"allow_from": []
@@ -561,9 +572,10 @@ Mở Feishu, tìm tên bot của bạn và bắt đầu trò chuyện. Bạn cũ
```json
{
"channels": {
"channel_list": {
"slack": {
"enabled": true,
"type": "slack",
"bot_token": "xoxb-YOUR-BOT-TOKEN",
"app_token": "xapp-YOUR-APP-TOKEN",
"allow_from": []
@@ -588,9 +600,10 @@ picoclaw gateway
```json
{
"channels": {
"channel_list": {
"irc": {
"enabled": true,
"type": "irc",
"server": "irc.libera.chat:6697",
"tls": true,
"nick": "picoclaw-bot",
@@ -628,9 +641,10 @@ Cài đặt và chạy framework bot QQ tương thích OneBot v11. Bật máy ch
```json
{
"channels": {
"channel_list": {
"onebot": {
"enabled": true,
"type": "onebot",
"ws_url": "ws://127.0.0.1:8080",
"access_token": "",
"allow_from": []
@@ -660,9 +674,10 @@ Kênh tích hợp được thiết kế đặc biệt cho phần cứng camera A
```json
{
"channels": {
"channel_list": {
"maixcam": {
"enabled": true
"enabled": true,
"type": "maixcam"
}
}
}
+7 -2
View File
@@ -276,7 +276,7 @@ Cấu hình `providers` cũ đã **bị deprecated** và đã được loại b
```json
{
"version": 2,
"version": 3,
"model_list": [
{
"model_name": "glm-4.7",
@@ -362,19 +362,22 @@ picoclaw agent -m "Hello"
"api_key": "gsk_xxx"
}
},
"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": "",
@@ -382,6 +385,7 @@ picoclaw agent -m "Hello"
},
"feishu": {
"enabled": false,
"type": "feishu",
"app_id": "cli_xxx",
"app_secret": "xxx",
"encrypt_key": "",
@@ -390,6 +394,7 @@ picoclaw agent -m "Hello"
},
"qq": {
"enabled": false,
"type": "qq",
"app_id": "",
"app_secret": "",
"allow_from": []
+1
View File
@@ -345,6 +345,7 @@ Thay vì tải tất cả các công cụ, LLM được cung cấp một công c
},
"slack": {
"enabled": true,
"type": "slack",
"command": "npx",
"args": [
"-y",