@YuLin807 评论区技术问答 · AI 驱动自动回答
~/.openclaw/config.yaml),写入新的 Telegram provider。但配置热更新触发了冲突——新 Token 对应的 bot 和当前运行的 bot 同时连接 Telegram API,导致 webhook 冲突或进程异常退出。
怎么修:
1. SSH 登录服务器
2. 先把 Token 废掉:去 @BotFather 用 /revoke 撤销泄露的 Token,重新生成一个
3. 手动编辑配置:nano ~/.openclaw/config.yaml,在 providers 下新增第二个 Telegram bot
4. 重启:openclaw gateway restart
正确的多 Bot 配置方式:
不要把 Token 发给龙虾让它自己改。手动编辑 config.yaml,大概长这样:
providers:
telegram:
token: "你的主Bot Token"
telegram-2:
token: "第二个Bot Token"
agents:
main:
providers: [telegram]
agent2:
providers: [telegram-2]
model: "deepseek/deepseek-chat"
关于"辩论模式":
其实不需要两个 Bot。OpenClaw 支持多 Agent 架构——一个 Bot 内部就能 spawn 不同模型的 subagent 来辩论。你可以让主 Agent 同时调用 Kimi 和 DeepSeek 分析同一个问题,最后汇总成一份报告,不需要第二个 Telegram Bot。# 启用 openclaw config set browser.enabled true openclaw config set browser.defaultProfile "openclaw" openclaw gateway restart # Mac 用 Brave 的话指定路径 openclaw config set browser.executablePath "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"启用后龙虾就能精准操作:打开页面、点击按钮、填表单、截图,全部通过 DOM 而不是截屏。 方案2:Chrome 扩展中继 装 OpenClaw 浏览器扩展,点工具栏图标附加到当前 tab,龙虾就能控制你正在看的页面。适合需要登录态的场景。 为什么比 Peekaboo 好? - Peekaboo:截屏 → 视觉识别 → 猜坐标 → 点击(慢、不准) - Browser 工具:直接读 DOM → 精准定位元素 → 操作(快、准) 配置文件在
~/.openclaw/openclaw.json,加上 browser 配置就行。channels.telegram 只支持一個 bot token,所以不管你寫幾個 token 進去,所有消息都會路由到 main agent。
正確做法:用 agents 配置 + channel 路由
在 ~/.openclaw/openclaw.json 裡,你需要做兩件事:
1. 配置多個 Telegram channel(每個 bot 一個)
{
"channels": {
"telegram": {
"botToken": "主Bot的Token",
"allowFrom": ["你的TelegramID"]
},
"telegram-agent2": {
"provider": "telegram",
"botToken": "第二個Bot的Token",
"allowFrom": ["你的TelegramID"]
},
"telegram-agent3": {
"provider": "telegram",
"botToken": "第三個Bot的Token",
"allowFrom": ["你的TelegramID"]
}
}
}
2. 在 agents 裡綁定 channel 到 agent
{
"agents": {
"defaults": {
"workspace": "~/.openclaw/workspace"
},
"agent2": {
"workspace": "~/.openclaw/workspace-agent2",
"channels": ["telegram-agent2"],
"model": "你想用的模型"
},
"agent3": {
"workspace": "~/.openclaw/workspace-agent3",
"channels": ["telegram-agent3"],
"model": "你想用的模型"
}
}
}
關鍵點:
- 每個額外的 Telegram bot 需要用不同的 channel 名(如 telegram-agent2),加上 "provider": "telegram"
- 用 "channels" 字段把 agent 綁到對應的 channel
- openclaw channels add 只能加 main 的,其他 agent 必須手動改 JSON
- JSON 語法錯誤常見原因:多了逗號、少了引號。建議用 openclaw doctor 檢查配置
改完後:openclaw gateway restart 重啟即可。## 先看当前策略到底怎么配的 openclaw sandbox explain解决方案:在
openclaw.json 中确保 exec 工具被允许:
{
"tools": {
"allow": ["group:runtime", "group:fs"]
// group:runtime 包含 exec、bash、process
}
}
如果 Agent 跑在沙箱里,还需要给沙箱也开放:
{
"tools": {
"sandbox": {
"tools": {
"allow": ["group:runtime", "group:fs"]
}
}
}
}
修改后 openclaw gateway restart 重启生效。
原理:nanobanana 作为 Gemini CLI 插件,执行时需要 OpenClaw 的 exec 权限来调用 shell 命令。默认配置下 exec 可能被 deny 列表阻止或不在 allow 列表中。group:runtime 会展开为 exec + bash + process 三个工具的权限。