
Dingtalk Message
This handles the full spectrum of DingTalk messaging, from simple webhook notifications to group chats to direct messages to work announcements. It supports all the message types you'd expect (text, Markdown, ActionCard, FeedCard) plus @ mentions, message recall, and read receipts. The skill includes a helper script that manages tokens and credentials, converts unionIds to userIds when needed, and routes your request to the right API endpoint. Four different messaging channels are supported depending on whether you're posting to a group, sending a private message, or broadcasting a company-wide notification. It's comprehensive but assumes you already know which DingTalk messaging scenario you need.
- skills.sh installs
- 1.6K
- GitHub stars
- 102
- last updated
- Aug 21, 2026
Install
$ npx -y skills add breath57/dingtalk-skills --skill dingtalk-message --agent claude-codeInstalls into .claude/skills of the current project.
Files
钉钉消息技能
负责钉钉消息发送的所有操作。本文件为策略指南;完整 API 请求格式、场景路由、消息类型速查、身份标识、错误码等见 references/api.md。
dt_helper.sh位于本SKILL.md同级目录的scripts/dt_helper.sh。
四种消息通道
| 通道 | 适用场景 | Token | 特点 |
|---|---|---|---|
| Webhook 机器人 | 往指定群发通知 | 无需 | 最简单;URL 自带凭证 |
| 企业内部应用机器人 | 单聊私信 / 群聊 | --token(新版) | 可撤回、查已读 |
| 工作通知 | 应用推送到"工作通知" | --old-token(旧版) | 可推全员/部门 |
| sessionWebhook | 回调中直接回复 | 无需 | 回调消息自带临时 URL |
工作流程(每次执行前)
- 识别通道 → 按 api.md「场景路由」判断属于哪个通道
- 校验配置 →
bash scripts/dt_helper.sh --get KEY读取该通道所需键值 - 收集缺失项 → 一次性询问并
bash scripts/dt_helper.sh --set KEY=VALUE写入 - 获取 Token → 机器人用
--token;工作通知用--old-token;Webhook/sessionWebhook 无需 - 执行 API → 多行逻辑写入
/tmp/<task>.sh再执行;禁止 heredoc
各通道所需配置
| 通道 | 所需配置 | 来源说明 |
|---|---|---|
| Webhook | DINGTALK_WEBHOOK_URL(加签额外需 DINGTALK_WEBHOOK_SECRET) | 群设置 → 智能群助手 → 添加自定义机器人 |
| 机器人消息 | DINGTALK_APP_KEY + DINGTALK_APP_SECRET | 开放平台 → 应用管理 → 凭证信息 |
| 工作通知 | DINGTALK_APP_KEY + DINGTALK_APP_SECRET + DINGTALK_AGENT_ID | agentId 在应用管理 → 基本信息 |
robotCode=appKey(完全一致,无需额外配置)- 凭证禁止在输出中完整打印,确认时仅显示前 4 位 +
****- 消息内容缺失时:先询问用户想发什么,不要自行编造
Sponsors
Details
- Repository
- github.com/breath57/dingtalk-skills
- First seen
- Apr 16, 2026