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


2. Telegram 机器人能力部署
编辑配置文件 C:\Users\Administrator\.openclaw\openclaw.json


添加以下配置段:
"channels":{"telegram":{"enabled": true, "dmPolicy":"pairing", "botToken":"<Your Bot Token>", "groupPolicy":"allowlist", "streamMode":"partial", "network":{"autoSelectFamily":true}, "proxy":"http://<Proxy IP>:<Proxy Port>", "actions":{"reactions": true, "sendMessage": true, "deleteMessage": true, "sticker":true}}}
2.1 对接 Telegram 机器人
打开 Telegram,搜索 @BotFather,发送 /newbot 来创建一个新的机器人,按提示设置:

给 Bot 起个名字,比如我设置为 人工智能我来了。

设置用户名(必须以 bot 结尾,比如 Renggongai0219Bot)。
最后会给你一串 Token:<Your Token>。
输入 token 进行对接,并进入到刚才创建的机器人里,第一次打开会显示还未正式对接,但是会在里面提供配对码,比如我的是 Pairing code: <Pairing Code>。

现在只需重新打开一个新的 PowerShell 窗口,然后在里面输入配对命令即可:
openclaw pairing approve telegram <Pairing Code>

当你看到这个界面的话说明已经和 Telegram 配对成功了!
版本升级到 3.12 后配置有点不一样了
1. 获取用户 ID
打开 Telegram → 搜索 @userinfobot → 发送 /start → 机器人会直接回复你的数字 ID(格式:Id: 1987654321)。

2. openclaw 配置
执行 openclaw onboard
◇ Telegram allowFrom (numeric sender id; @username resolves to id) │ XXXXXX(输入上图 ID 的数字)
3. 网页搜索能力部署
编辑配置文件 C:\Users\Administrator\.openclaw\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":"<Your Token>", "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":"<Your Password>"}, "tailscale":{"mode":"off", "resetOnExit":false}, "remote":{"url":"ws://127.0.0.1:18789", "token":"<Your Password>"}, "nodes":{"denyCommands":["camera.snap", "camera.clip", "screen.record", "calendar.add", "contacts.add", "reminders.add"]}}, "skills":{"install":{"nodeManager":"npm"}}, "plugins":{"entries":{"telegram":{"enabled":true}}}}


