钉钉企业内部机器人渠道快速对接。Use when: 用户需要对接钉钉渠道、配置钉钉 Stream 模式、排查钉钉消息问题。NOT for: 飞书/Lark、企业微信等其他平台。
钉钉企业内部机器人渠道快速对接指南。
✅ USE this skill when:
❌ DON'T use when:
feishu skillwecom skill确保已准备:
国内网络环境(推荐使用镜像):
$env:NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
openclaw plugins install @soimy/dingtalk
国际网络:
openclaw plugins install @soimy/dingtalk
如需代理:
$env:HTTP_PROXY="http://127.0.0.1:7897"
$env:HTTPS_PROXY="http://127.0.0.1:7897"
openclaw plugins install @soimy/dingtalk
编辑 ~/.openclaw/openclaw.json,添加插件到白名单:
{
"plugins": {
"enabled": true,
"allow": ["dingtalk"]
}
}
如果已有其他插件,添加到数组中:
{
"plugins": {
"allow": ["telegram", "discord", "dingtalk"]
}
}
方式一:交互式配置(推荐)
openclaw configure --section channels
按提示操作:
方式二:手动编辑配置文件
编辑 ~/.openclaw/openclaw.json,添加 channel 配置:
{
"channels": [
{
"id": "dingtalk",
"plugin": "dingtalk",
"enabled": true,
"clientId": "your_client_id",
"clientSecret": "your_client_secret",
"dm": "open",
"group": "open"
}
]
}
完整配置示例:
{
"id": "dingtalk",
"plugin": "dingtalk",
"enabled": true,
"clientId": "ding3ti4ahg82dsfkwld",
"clientSecret": "FrpMFcI30c0STvaJJWyMSZoyeb2Hkm9YqXY-6mJ0dGwdN8Xux7mgT_Xn7qnpvO-F",
"robotCode": "your_robot_code",
"corpId": "your_corp_id",
"agentId": "your_agent_id",
"aiCard": false,
"dm": "open",
"group": "open"
}
方式三:自动化脚本(推荐批量部署)
使用提供的 PowerShell 脚本:
.\scripts\auto-setup.ps1 -ClientId "your_id" -ClientSecret "your_secret"
完整参数:
.\scripts\auto-setup.ps1 `
-ClientId "ding3ti4ahg82dsfkwld" `
-ClientSecret "FrpMFcI30c0STvaJJWyMSZoyeb2Hkm9YqXY-6mJ0dGwdN8Xux7mgT_Xn7qnpvO-F" `
-RobotCode "your_robot_code" `
-CorpId "your_corp_id" `
-AgentId "your_agent_id" `
-UseProxy
openclaw gateway restart
| 参数 | 必需 | 说明 | 默认值 |
|---|---|---|---|
clientId | ✅ | DingTalk App Key | - |
clientSecret | ✅ | DingTalk App Secret | - |
robotCode | ❌ | 机器人代码 | - |
corpId | ❌ | 企业 ID | - |
agentId | ❌ | 应用 Agent ID | - |
aiCard | ❌ | 启用 AI 互动卡片 | false |
dm | ❌ | 私聊策略:open / allowlist | open |
group | ❌ | 群聊策略:open / allowlist | open |
测试连接:
# 检查 Gateway 状态
openclaw gateway status
# 查看日志
openclaw logs gateway
# 列出插件
openclaw plugins list
在钉钉中给机器人发送消息,应该能收到回复。
如果安装停在 "Installing plugin dependencies...":
cd ~/.openclaw/extensions/dingtalk
rm -rf node_modules package-lock.json
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com npm install
openclaw gateway restart
检查清单:
✅ Gateway 运行中
openclaw gateway status
✅ 插件在白名单
检查 openclaw.json 中的 plugins.allow 包含 "dingtalk"
✅ 渠道已启用
检查 channels[].enabled 为 true
✅ 凭证正确 在钉钉开放平台验证 Client ID/Secret
✅ 重启 Gateway
openclaw gateway restart
# 设置 npm 镜像
$env:NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
# 设置代理(如需要)
$env:HTTP_PROXY="http://127.0.0.1:7897"
$env:HTTPS_PROXY="http://127.0.0.1:7897"
"Plugin not found"
openclaw plugins list~/.openclaw/extensions/dingtalk"Connection failed"
openclaw logs gateway"Plugin not loaded"
dingtalk 到 plugins.allow~/.openclaw/openclaw.json~/.openclaw/extensions/dingtalkopenclaw logs gatewayscripts/auto-setup.ps1ZIP package — ready to use