Openclaw_TelegramBot配置
代理问题
1 | # 代理问题 |
Telegram bot 报错: Network request for ‘setMyCommands’ failed!
1 | 这说明无法连接到 Telegram API。 |
发现你的 mihomo 代理运行在 127.0.0.1:7890
3. 查阅文档
看了 OpenClaw 的 Telegram 文档,发现有专门的 proxy 配置字段!
4. 修改配置文件
在 /root/.openclaw/openclaw.json 的 channels.telegram 部分添加:
1 | "channels": { |
5. 重启服务
1 | systemctl --user restart openclaw-gateway |
6. 验证成功
- 不再有 Network failed 错误
- 收到 pairing 请求
- 批准后 bot 正常工作
关键点:
OpenClaw 的 Telegram 插件需要在配置文件里单独设置 proxy,不能只靠环境变量!
切换到 allowlist 并把你自己加白名单(DM + 群组都要)
openclaw config set channels.telegram.dmPolicy allowlist
openclaw config set channels.telegram.allowFrom [“你的UserID”]
openclaw config set channels.telegram.groupPolicy allowlist
openclaw config set channels.telegram.groupAllowFrom [“你的UserID”]
让所有群组都不强制 @(可改成具体群)
openclaw config set channels.telegram.groups.’‘.requireMention false
openclaw config set channels.telegram.groups.’‘.groupPolicy allowlist
想看当前完整配置:
openclaw config get channels.telegram
群组/指令失效问题
问题原因
官方在 2.25+ 做了权限系统安全强化(官方 Changelog 已明确说明):
安全边界变更(2026.2.25+):群组发送者授权不再继承 DM pairing-store 的允许。 群组必须单独设置 groupAllowFrom,否则 /status /help 等指令直接被拦截(普通聊天还能走 message handler,所以看起来“群组基本对话可以”)。 bot 自己弹出的“权限系统问题,需要管理员处理”就是它检测到这个不一致后主动提醒的。
这是安全升级(防止别人乱用你的 bot),但升级后没重新配置的用户都会中招。
解决方法
1、在openclaw里添加
1 | "channels": { |
Openclaw_TelegramBot配置
http://example.com/2026/02/25/Openclaw/Openclaw_TelegramBot配置/