- Upgrade Go version from 1.24 to 1.26.1 with updated dependencies
- Replace interface{} with any type throughout codebase
- Add message deduplication in OneBot11 adapter to prevent duplicate event processing
- URL-encode access token in WebSocket connections to handle special characters
- Remove duplicate bot startup hooks in DI providers (now handled by botManager.StartAll)
- Use slices.Clone and errgroup.Go patterns for cleaner concurrent code
- Apply omitzero JSON tags for optional fields (Go 1.24+ feature)
58 lines
1.0 KiB
TOML
58 lines
1.0 KiB
TOML
# CellBot Configuration
|
|
|
|
[server]
|
|
host = "0.0.0.0"
|
|
port = 8080
|
|
|
|
[log]
|
|
level = "info"
|
|
output = "logs/cellbot.log"
|
|
max_size = 100 # MB
|
|
max_backups = 3
|
|
max_age = 7 # days
|
|
|
|
[protocol]
|
|
name = "milky"
|
|
version = "1.0"
|
|
|
|
[protocol.options]
|
|
# Protocol specific options can be added here
|
|
|
|
[engine.rate_limit]
|
|
enabled = true
|
|
rps = 100 # 每秒请求数
|
|
burst = 200 # 突发容量
|
|
|
|
# ============================================================================
|
|
# Bot 配置
|
|
# ============================================================================
|
|
|
|
# Milky Bot 示例
|
|
[[bots]]
|
|
id = "milky_bot_1"
|
|
protocol = "milky"
|
|
enabled = false
|
|
|
|
[bots.milky]
|
|
protocol_url = "http://localhost:3000"
|
|
access_token = "your_token_here"
|
|
event_mode = "sse"
|
|
timeout = 30
|
|
retry_count = 3
|
|
|
|
# OneBot11 Bot 示例
|
|
[[bots]]
|
|
id = "onebot11_bot_1"
|
|
protocol = "onebot11"
|
|
enabled = true
|
|
|
|
[bots.onebot11]
|
|
connection_type = "ws"
|
|
self_id = "3177182228"
|
|
nickname = "TestBot"
|
|
ws_url = "ws://127.0.0.1:3001"
|
|
access_token = "]W4cjp#9W3l:p4_r"
|
|
timeout = 30
|
|
heartbeat = 30
|
|
reconnect_interval = 5
|