将 OpenClaw 接入量子密信即时通讯平台。
功能说明📝 文本消息支持普通文本、@提及、富文本🖼️ 图片消息自动上传发送,支持多种格式📎 文件消息自动上传发送(≤30MB)📰 图文消息支持链接卡片展示👥 群聊支持群消息接收与回复🔐 安全配对私聊配对码验证机制📊 多账号支持多个量子密信账号
✅ 使用此插件:
❌ 不使用此插件:
bash
# 从 ClawHub 安装
openclaw plugins install clawhub:quantum-im
# 安装依赖
cd ~/.openclaw/extensions/quantum-im
npm install
编辑 ~/.openclaw/openclaw.json:
json
{
"channels": {
"quantum-im": {
"enabled": true,
"robotId": "你的机器人 ID",
"key": "你的回调密钥",
"host": "http://imtwo.zdxlz.com",
"webhookPort": 3777,
"webhookPath": "/quantum-im",
"dmSecurity": "pairing",
"allowFrom": [],
"agent": "main"
}
},
"plugins": {
"entries": {
"quantum-im": {
"enabled": true
}
}
}
}
在量子密信机器人管理后台,设置回调 URL:
text
http://<你的服务器 IP>:3777/quantum-im
bash
openclaw gateway restart
openclaw channels status
字段类型必填默认值说明robotIdstring✅-量子密信机器人 IDkeystring✅-回调 URL 中的密钥hoststring❌http://imtwo.zdxlz.com量子密信 API 主机webhookPortnumber❌3777webhook 监听端口webhookPathstring❌/quantum-imwebhook 路径dmSecuritystring❌pairing私聊安全策略allowFromstring[]❌[]手机号白名单agentstring❌main处理消息的智能体
策略说明推荐场景pairing新联系人需要配对码验证✅ 推荐,平衡安全与便利allowlist只有白名单中的手机号可发消息🔒 高安全,内部使用open任何人都可以发消息⚠️ 慎用,可能被骚扰
白名单配置示例:
json
{
"dmSecurity": "allowlist",
"allowFrom": ["13800138000", "13900139000"]
}
bash
curl -X POST http://localhost:3777/quantum-im \
-H "Content-Type: application/json" \
-d '{
"type": "text",
"callBackUrl": "",
"phone": "18800001111",
"textMsg": { "content": "Hello OpenClaw!" }
}'
成功响应: {"success": true}
bash
# 检查插件
openclaw plugins list
# 检查渠道
openclaw channels status
# 检查端口
ss -tlnp | grep 3777
plugins.entries.quantum-im.enabled = truess -tlnp | grep 3777openclaw logs --follow | grep quantum首次联系时系统自动发送配对码提示。输入配对码完成验证后即可正常通信。
在 accounts 中添加多个账号配置,每个账号使用不同的 webhookPort。
问题可能原因解决方法端口未监听插件未启用enabled: true收不到消息回调 URL 错误检查量子密信后台发送失败API Key 错误检查 robotId 和 key网关启动失败配置错误openclaw doctor --fix
MIT License © 2026 Michael Johnny