2026年OpenClaw本地配置QQ Bot的使用流程

OpenClaw本地配置QQ Bot的使用流程div id navCategory div p 本文档用于在本地 Mac 环境把 code OpenClaw Bot code 打通 并完成 p 机器人接入 OpenClaw 多账号配置 可选 指定 Bot 路由到指定 Agent

大家好,我是讯享网,很高兴认识大家。这里提供最前沿的Ai技术和互联网信息。



 
  
    
    

本文档用于在本地 Mac 环境把 OpenClaw + Bot 打通,并完成:

  • 机器人接入 OpenClaw
  • 多账号配置(可选)
  • 指定 Bot 路由到指定 Agent
  • 启动后可直接在 对话触发对应 Agent

确保以下条件已满足:

  • 已安装 OpenClaw CLI
  • 已有可用的 机器人 AppID 与 AppSecret
  • 本机可访问 registry.npmjs.org、bots..com、api.sgroup..com

可先检查版本:

GPT plus 代充 只需 145openclaw --version node -v npm -v
openclaw plugins install @tencent-connect/openclaw-bot@latest

安装后可确认插件已加载:

GPT plus 代充 只需 145openclaw plugins list | rg -i bot

如果安装插件时报错 UNABLE_TO_GET_ISSUER_CERT_LOCALLY,执行:

mkdir -p ~/.certs security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain > ~/.certs/macos-root-certs.pem security find-certificate -a -p /Library/Keychains/System.keychain > ~/.certs/macos-system-certs.pem cat ~/.certs/macos-root-certs.pem ~/.certs/macos-system-certs.pem > ~/.certs/macos-all-certs.pem npm config set cafile "$HOME/.certs/macos-all-certs.pem" npm config set strict-ssl true

然后重试插件安装。

建议把凭据存 Keychain,不要把明文写到文档或脚本里。

  • AppID: 开放平台里的机器人 ID(纯数字)
  • AppSecret:机器人密钥
  • token(OpenClaw 命令里):AppID:AppSecret
  • accountId(例如 bot1):OpenClaw 路由用的账号标识,不是密钥

也就是说:bot1 不是 token,本质是你在 --account 配置后用于路由匹配的账号 ID(插件会做小写规范化)。

Token 格式:

示例(会覆盖同名项):

security add-generic-password -a "$USER" -s "Key1" -w "APPID_1:APPSECRET_1" -U security add-generic-password -a "$USER" -s "Key2" -w "APPID_2:APPSECRET_2" -U

验证能读到(只验证,不要泄漏到聊天记录):

GPT plus 代充 只需 145security find-generic-password -a "$USER" -s "Key1" -w

https://q..com/bot/openclaw/

开放平台“OpenClaw 原生接入流程”里的 3 条命令,含义如下:

  1. 安装插件
openclaw plugins install @tencent-connect/openclaw-bot@latest
  1. 绑定当前 机器人(--token 就是 AppID:AppSecret
GPT plus 代充 只需 145openclaw channels add --channel bot --token "AppID:AppSecret"
  1. 重启 OpenClaw 服务
openclaw gateway restart

补充说明:

  • 如果是多机器人,建议加 --account,例如 --account bot1
  • 之后在 agents bind 使用的是 accountId(如 bot1),不是 token
  • 截图里如果出现过完整 AppSecret,建议在 开放平台立即轮换(重置)AppSecret
GPT plus 代充 只需 145openclaw channels add --channel bot --account bot1 --token "$(security find-generic-password -a "$USER" -s "Key1" -w)"
openclaw channels add --channel bot --account bot1 --token "$(security find-generic-password -a "$USER" -s "Key1" -w)" openclaw channels add --channel bot --account bot2 --token "$(security find-generic-password -a "$USER" -s "Key2" -w)"

查看已配置账号:

GPT plus 代充 只需 145openclaw channels list --json | sed -n '/^{/,$p' | jq '.chat.bot'

注意:插件通常会把 accountId 规范成小写,例如 Bot1 -> bot1

openclaw agents add _agent_bot --non-interactive --workspace ~/.openclaw/workspace-_agent_bot --json openclaw agents add _agent_edit_bot --non-interactive --workspace ~/.openclaw/workspace-_agent_edit_bot --json
GPT plus 代充 只需 145openclaw agents bind --agent _agent_bot --bind bot:bot1 --json openclaw agents bind --agent _agent_edit_bot --bind bot:bot2 --json

查看绑定结果:

openclaw agents bindings --json | sed -n '/^\[/,$p' | jq '.'

如果之前绑过泛路由(bot),建议移除,避免冲突:

GPT plus 代充 只需 145openclaw agents unbind --agent _agent_bot --bind bot --json
openclaw gateway restart
GPT plus 代充 只需 145openclaw channels status

期望看到类似:

  • Bot bot1: enabled, configured
  • Bot bot2: enabled, configured
rg -n "bot:bot1|bot:bot2|READY|WebSocket connected|Access token obtained" ~/.openclaw/logs/gateway.log -S | tail -n 80

出现以下日志即表示在线:

  • Access token obtained successfully
  • WebSocket connected
  • Dispatch event: t=READY 或 t=RESUMED
GPT plus 代充 只需 145# 查看所有 agent openclaw agents list # 查看绑定关系 openclaw agents bindings # 重启网关 openclaw gateway restart # 查看网关日志 tail -f ~/.openclaw/logs/gateway.log
  • 参考本文第 3 节设置 npm cafile
  • 确保 ~/.certs/macos-all-certs.pem 不是空文件
  • 这是当前 shell 未加载对应环境变量导致
  • 若你依赖 ~/.zshrc + Keychain 注入,先执行 source ~/.zshrc

优先检查:

  • 是否绑定成了错误的 accountId(大小写)
  • 是否还保留了泛路由 bot 抢路由
  • openclaw agents bindings 是否存在精准规则 bot:

  • 显式给每个 Bot 配 agent bind
  • 避免只依赖默认路由

# 1) 安装插件 openclaw plugins install @tencent-connect/openclaw-bot@latest

2) 存 token 到 keychain(示例)

security add-generic-password -a “$USER” -s “Key1” -w “APPID_1:APPSECRET_1” -U

3) 配置频道账号

openclaw channels add –channel bot –account bot1 –token “\((security find-generic-password -a "\)USER” -s “Key1” -w)”

4) 创建并绑定 agent

openclaw agents add _agent_bot –non-interactive –workspace ~/.openclaw/workspace-_agent_bot openclaw agents bind –agent _agent_bot –bind bot:bot1

5) 重启并看日志

openclaw gateway restart rg -n “bot:bot1|READY|WebSocket connected” ~/.openclaw/logs/gateway.log -S | tail -n 50

到此这篇关于OpenClaw本地配置 Bot的使用流程的文章就介绍到这了,更多相关OpenClaw 本地配置 Bot内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!

小讯
上一篇 2026-03-19 18:16
下一篇 2026-03-19 18:14

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/245268.html