1. 部署基础与功能扩展
按照第一集的部署完成后,我们开始考虑给 OpenClaw 增加 Telegram 机器人和搜索网站能力,实现效果如下:


2. Telegram 机器人能力部署
打开配置文件 openclaw.json(路径:C:\Users\Administrator\.openclaw)。


在配置文件中增加以下内容:
"channels":{"telegram":{"enabled": true, "dmPolicy":"pairing", "botToken":"你的 telegram 机器人的 token", "groupPolicy":"allowlist", "streamMode":"partial", "network":{"autoSelectFamily":true}, "proxy":"http://你的代理 IP:你的代理端口", "actions":{"reactions": true, "sendMessage": true, "deleteMessage": true, "sticker":true}}},
2.1 创建 Telegram 机器人
打开 Telegram,搜索 @BotFather,发送 /newbot 创建新机器人。按提示设置机器人名称(例如:人工智能我来了)和用户名(必须以 bot 结尾,如 Renggongai0219Bot)。


最后会获得一串 Token,将其填入上述配置文件的 botToken 字段。
2.2 配对机器人
进入刚才创建的机器人,第一次打开会显示未正式对接,并提供配对码(Pairing code)。

在 PowerShell 窗口中输入配对命令:
openclaw pairing approve telegram 这里填写你的配对码

看到上述界面说明已与 Telegram 配对成功。
2.3 版本升级注意事项
版本升级到 3.12 后配置略有不同:
- 打开 Telegram,搜索
@userinfobot,发送/start,机器人会回复你的数字 ID(格式:Id: 1987654321)。

- 在
openclaw配置中设置Telegram allowFrom为上述数字 ID。
openclaw onboard
◇ Telegram allowFrom (numeric sender id; @username resolves to id)
│ XXXXXX(输入上图 ID 的数字)
3. 搜索网站能力部署
打开配置文件 openclaw.json。


增加以下内容:
"tools":{"web":{"search":{}, "fetch":{"maxChars":20000, "timeoutSeconds":30, "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"}}},
4. 完整配置文件示例
{"meta":{"lastTouchedVersion":"2026.2.19-2", "lastTouchedAt":"2026-02-21T06:04:19.113Z"}, "wizard":{"lastRunAt":"2026-02-21T06:04:19.057Z", "lastRunVersion":"2026.2.19-2", "lastRunCommand":"onboard", "lastRunMode":"local"}, "logging":{"level":"info"}, "models":{"providers":{"ollama":{"baseUrl":"http://127.0.0.1:11434/v1", "apiKey":"ollama-local", "api":"openai-completions", "models":[{"id":"gpt-oss:20b", "name":"gpt-oss:20b", "reasoning": false, "input":["text"], "cost":{"input":0, "output":0, "cacheRead":0, "cacheWrite":0}, "contextWindow":131072, "maxTokens":16384}]}}, "agents":{"defaults":{"model":{"primary":"ollama/gpt-oss:20b"}, "models":{"ollama/gpt-oss:20b":{}}, "workspace":"C:\Users\Administrator\.openclaw\workspace", "compaction":{"mode":"safeguard"}, "maxConcurrent":4, "subagents":{"maxConcurrent":8}}}, "tools":{"web":{"search":{}, "fetch":{"maxChars":20000, "timeoutSeconds":30, "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"}}}, "messages":{"ackReactionScope":"group-mentions"}, "commands":{"native":"auto", "nativeSkills":"auto", "restart":true}, "hooks":{"internal":{"enabled": true, "entries":{"boot-md":{"enabled":true}, "session-memory":{"enabled":true}}}}, "channels":{"telegram":{"enabled": true, "dmPolicy":"pairing", "botToken":"用你自己的代替", "groupPolicy":"allowlist", "streamMode":"partial", "network":{"autoSelectFamily":true}, "proxy":"http://127.0.0.1:7897", "actions":{"reactions": true, "sendMessage": true, "deleteMessage": true, "sticker":true}}}, "gateway":{"port":18789, "mode":"local", "bind":"loopback", "auth":{"mode":"token", "token":"用你自己的代替"}, "tailscale":{"mode":"off", "resetOnExit":false}, "remote":{"url":"ws://127.0.0.1:18789", "token":"你设置的密码代替"}, "nodes":{"denyCommands":["camera.snap", "camera.clip", "screen.record", "calendar.add", "contacts.add", "reminders.add"]}}, "skills":{"install":{"nodeManager":"npm"}}, "plugins":{"entries":{"telegram":{"enabled":true}}}}

