配置并管理QQ官方机器人,支持身份认证、IP白名单设置、Webhook/WebSocket连接及OpenClaw AI集成。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install qqbot或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install qqbot⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/qqbot/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
QQ 官方机器人 (QQ Bot) 完整配置教程,包含从创建机器人到接入 OpenClaw AI 的全过程,以及常见问题排查。
---
- AppID (如: 102842119) - AppSecret (点击显示,只显示一次,务必保存!)
⚠️ 重要: AppSecret 只显示一次,立即保存!
---
家庭宽带需要公网 IP,并配置到 QQ 开放平台。
curl https://api.ipify.org
⚠️ 注意: 家庭宽带 IP 会定期变化,需要及时更新白名单,否则会出现错误 11298。
---
在 openclaw.json 中添加 QQ 频道配置:
{
"channels": {
"qq": {
"enabled": true,
"appId": "你的AppID",
"appSecret": "你的AppSecret"
}
}
}
---
复制 qq_official_bot.py 到工作区:
cp qq_official_bot.py ~/.openclaw/workspace/
编辑配置文件:
APP_ID = "你的AppID"
APP_SECRET = "你的AppSecret"
---
# 启动 QQ Bot
~/.openclaw/workspace/qq_bot_daemon.sh start
# 查看状态
~/.openclaw/workspace/qq_bot_daemon.sh status
# 查看日志
tail -f ~/.openclaw/workspace/qq_bot.log
---
现象:
获取 Token 失败: 11298
接口访问源IP不在白名单
原因:
解决方案:
curl https://api.ipify.org长期方案:
---
现象:
原因 1: Intents 权限未开启
解决方案:
- ✅ GUILDS (基础权限) - ✅ GROUP_AND_C2C_EVENT (私聊和群消息) - ✅ AT_MESSAGES (@消息)
原因 2: 事件订阅方式错误
解决方案: 确认选择了「使用长连接接收事件」(WebSocket 模式),而不是 HTTP 回调。
原因 3: 机器人未添加好友/进群
解决方案:
---
现象:
ModuleNotFoundError: No module named 'requests'
ModuleNotFoundError: No module named 'aiohttp'
解决方案:
pip3 install requests aiohttp websockets --user
---
现象:
✅ 鉴权成功!
Session ID: xxx
💓 心跳确认
但没有收到 C2C_MESSAGE_CREATE 或 AT_MESSAGE_CREATE 事件。
原因: Intents 值配置错误
解决方案: 使用正确的 Intents 组合:
INTENTS = (1 << 0) | (1 << 25) | (1 << 30)
# GUILDS | GROUP_AND_C2C_EVENT | AT_MESSAGES
---
现象:
⏳ 等待 OpenClaw AI 回复...
抱歉,AI 响应超时
原因: AI 处理器未运行或响应太慢
解决方案:
---
~/.openclaw/workspace/
├── qq_official_bot.py # QQ Bot 主程序
├── qq_bot_daemon.sh # 启动管理脚本
├── qq_bot.log # 运行日志
├── qq_queue/ # 消息队列目录
│ ├── ai_request_*.json # AI 请求
│ └── ai_response_*.txt # AI 回复
└── qq_ai_handler.sh # AI 处理器
---
# 启动
~/.openclaw/workspace/qq_bot_daemon.sh start
# 停止
~/.openclaw/workspace/qq_bot_daemon.sh stop
# 重启
~/.openclaw/workspace/qq_bot_daemon.sh restart
# 查看状态
~/.openclaw/workspace/qq_bot_daemon.sh status
# 查看日志
tail -f ~/.openclaw/workspace/qq_bot.log
---
tail -f ~/.openclaw/workspace/qq_bot.log | grep -E "连接|心跳|收到"
tail -f ~/.openclaw/workspace/qq_bot.log | grep "收到事件"
# 创建测试请求
echo '{"request_id":"test","message":"你好"}' > ~/.openclaw/workspace/qq_queue/ai_request_test.json
# 创建回复
echo "你好!我是小皮" > ~/.openclaw/workspace/qq_queue/ai_response_test.txt
---
---
维护者: 小皮 🦊 版本: 1.0.0 更新时间: 2026-02-23
安装 qqbot 后,可以对 AI 说这些话来触发它
Help me get started with qqbot
Explains what qqbot does, walks through the setup, and runs a quick demo based on your current project
Use qqbot to configure and manage QQ official robots, supporting identity authen...
Invokes qqbot with the right parameters and returns the result directly in the conversation
What can I do with qqbot in my ai agent & automation workflow?
Lists the top use cases for qqbot, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/qqbot/ 目录(个人级,所有项目可用),或 .claude/skills/qqbot/(项目级)。重启 AI 客户端后,用 /qqbot 主动调用,或让 AI 根据上下文自动发现并使用。
qqbot 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
qqbot 可免费安装使用。请查阅仓库了解许可证信息。
配置并管理QQ官方机器人,支持身份认证、IP白名单设置、Webhook/WebSocket连接及OpenClaw AI集成。
qqbot 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my ai agent & automation tasks using qqbot
Identifies repetitive steps in your workflow and sets up qqbot to handle them automatically