返回顶部
d

dingtalk-setup钉钉对接配置

钉钉企业内部机器人渠道快速对接。Use when: 用户需要对接钉钉渠道、配置钉钉 Stream 模式、排查钉钉消息问题。NOT for: 飞书/Lark、企业微信等其他平台。

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,106
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

dingtalk-setup

钉钉渠道设置

钉钉企业内部机器人渠道快速对接指南。

何时使用

使用此技能的场景:

  • - 用户说对接钉钉、配置钉钉机器人
  • 钉钉消息没有响应,需要排查
  • 需要安装钉钉插件
  • DingTalk channel setup

不要使用的场景:

  • - 飞书/Lark 配置 → 使用 feishu 技能
  • 企业微信 → 使用 wecom 技能
  • Telegram/Discord → 使用相应的渠道技能

前置条件

确保已准备:

  1. 1. 钉钉开放平台企业内部应用(已创建)
  2. Client ID (AppKey)
  3. Client Secret (AppSecret)
  4. 可选:Robot Code、Corp ID、Agent ID

安装

步骤 1:安装插件

国内网络环境(推荐使用镜像):

powershell
$env:NPMCONFIGREGISTRY=https://registry.npmmirror.com
openclaw plugins install @soimy/dingtalk

国际网络:

bash
openclaw plugins install @soimy/dingtalk

如需代理:

powershell
$env:HTTP_PROXY=http://127.0.0.1:7897
$env:HTTPS_PROXY=http://127.0.0.1:7897
openclaw plugins install @soimy/dingtalk

步骤 2:启用插件

编辑 ~/.openclaw/openclaw.json,添加插件到白名单:

json
{
plugins: {
enabled: true,
allow: [dingtalk]
}
}

如果已有其他插件,添加到数组中:

json
{
plugins: {
allow: [telegram, discord, dingtalk]
}
}

步骤 3:配置渠道

方式一:交互式配置(推荐)

bash
openclaw configure --section channels

按提示操作:

  1. 1. 选择 Add a new channel
  2. 选择 DingTalk (钉钉)
  3. 输入 Client ID
  4. 输入 Client Secret
  5. 选择是否配置完整信息(推荐 Yes)
  6. 配置其他选项(DM/Group 策略等)
  7. 完成配置

方式二:手动编辑配置文件

编辑 ~/.openclaw/openclaw.json,添加 channel 配置:

json
{
channels: [
{
id: dingtalk,
plugin: dingtalk,
enabled: true,
clientId: yourclientid,
clientSecret: yourclientsecret,
dm: open,
group: open
}
]
}

完整配置示例:

json
{
id: dingtalk,
plugin: dingtalk,
enabled: true,
clientId: ding3ti4ahg82dsfkwld,
clientSecret: FrpMFcI30c0STvaJJWyMSZoyeb2Hkm9YqXY-6mJ0dGwdN8Xux7mgT_Xn7qnpvO-F,
robotCode: yourrobotcode,
corpId: yourcorpid,
agentId: youragentid,
aiCard: false,
dm: open,
group: open
}

步骤 4:重启网关

bash
openclaw gateway restart

配置选项

参数必需说明默认值
clientId钉钉 App Key-
clientSecret
✅ | 钉钉 App Secret | - | | robotCode | ❌ | 机器人代码 | - | | corpId | ❌ | 企业 ID | - | | agentId | ❌ | 应用 Agent ID | - | | aiCard | ❌ | 启用 AI 互动卡片 | false | | dm | ❌ | 私聊策略:open / allowlist | open | | group | ❌ | 群聊策略:open / allowlist | open |

验证

测试连接:

bash

检查 Gateway 状态


openclaw gateway status

查看日志

openclaw logs gateway

列出插件

openclaw plugins list

在钉钉中给机器人发送消息,应该能收到回复。

故障排除

插件安装卡住

如果安装停在 Installing plugin dependencies...:

bash
cd ~/.openclaw/extensions/dingtalk
rm -rf node_modules package-lock.json
NPMCONFIGREGISTRY=https://registry.npmmirror.com npm install
openclaw gateway restart

机器人无响应

检查清单:

  1. 1. ✅ Gateway 运行中
bash openclaw gateway status
  1. 2. ✅ 插件在白名单
检查 openclaw.json 中的 plugins.allow 包含 dingtalk
  1. 3. ✅ 渠道已启用
检查 channels[].enabled 为 true
  1. 4. ✅ 凭证正确
在钉钉开放平台验证 Client ID/Secret
  1. 5. ✅ 重启 Gateway
bash openclaw gateway restart

网络问题(中国大陆)

powershell

设置 npm 镜像


$env:NPMCONFIGREGISTRY=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
  • 重启 Gateway

自动设置(可选)

如果需要自动化批量部署,可以创建以下 PowerShell 脚本:

auto-setup.ps1

powershell

DingTalk Channel Auto Setup Script


Usage: .\auto-setup.ps1 -ClientId xxx -ClientSecret xxx

param(
[Parameter(Mandatory=$true)]
[string]$ClientId,

[Parameter(Mandatory=$true)]
[string]$ClientSecret,

[string]$RobotCode = ,
[string]$CorpId = ,
[string]$AgentId = ,
[string]$ProxyUrl = http://127.0.0.1:7897,
[string]$NpmRegistry = https://registry.npmmirror.com,
[switch]$UseProxy = $false
)

Write-Host === DingTalk Channel Auto Setup === -ForegroundColor Cyan

Set proxy if needed

if ($UseProxy) { $env:HTTP_PROXY = $ProxyUrl $env:HTTPS_PROXY = $ProxyUrl }

Set npm registry

$env:NPMCONFIGREGISTRY = $NpmRegistry

Install plugin

Write-Host Installing plugin... -ForegroundColor Yellow openclaw plugins install @soimy/dingtalk

Update openclaw.json

Write-Host Updating configuration... -ForegroundColor Yellow $configPath = $env:USERPROFILE\.openclaw\openclaw.json $config = Get-Content $configPath -Raw | ConvertFrom-Json

Add plugin to allowlist

if (-not $config.plugins) { $config | Add-Member -MemberType NoteProperty -Name plugins -Value @{ enabled = $true allow = @(dingtalk) } } else { if (-not $config.plugins.allow) { $config.plugins | Add-Member -MemberType NoteProperty -Name allow -Value @(dingtalk) } elseif ($config.plugins.allow -notcontains dingtalk) { $config.plugins.allow += dingtalk } }

Add channel configuration

if (-not $config.channels) { $config | Add-Member -MemberType NoteProperty -Name channels -Value @() }

$dingtalkConfig = @{
id = dingtalk
plugin = dingtalk
enabled = $true
clientId = $ClientId
clientSecret = $ClientSecret
dm = open
group = open
}

if ($RobotCode) { $dingtalkConfig

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 dingtalk-setup-1776186985 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 dingtalk-setup-1776186985 技能

通过命令行安装

skillhub install dingtalk-setup-1776186985

下载

⬇ 下载 dingtalk-setup v1.0.0(免费)

文件大小: 4.68 KB | 发布时间: 2026-4-15 10:20

v1.0.0 最新 2026-4-15 10:20
钉钉企业内部机器人渠道快速对接指南。支持交互式配置、自动化脚本和手动设置。包含故障排查指南和国内网络优化。支持 Stream 模式(无需公网 IP)。

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部