breath57 avatar

Dingtalk Message

Dingtalk robot and work-notification message skill covering four send channels with Webhook, app, and session routing.

skills.sh installs
1.6K
GitHub stars
102
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers group Webhook bots (text, Markdown, ActionCard, Link, FeedCard), enterprise app bots for one-to-one and group chats, and work notifications
  • Includes scripts/dt_helper.sh for reading and writing config keys, fetching access tokens, and converting unionId to userId
  • Enforces userId-only identity for message APIs and asks which group send method to use before sending
  • Designed for workflows that send, recall, or check read status of DingTalk messages through the open platform

Install

$ npx -y skills add breath57/dingtalk-skills --skill dingtalk-message -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

钉钉消息技能

负责钉钉消息发送的所有操作。本文件为策略指南;完整 API 请求格式、场景路由、消息类型速查、身份标识、错误码等见 references/api.md。

dt_helper.sh 位于本 SKILL.md 同级目录的 scripts/dt_helper.sh。

四种消息通道

通道适用场景Token特点
Webhook 机器人往指定群发通知无需最简单;URL 自带凭证
企业内部应用机器人单聊私信 / 群聊--token(新版)可撤回、查已读
工作通知应用推送到"工作通知"--old-token(旧版)可推全员/部门
sessionWebhook回调中直接回复无需回调消息自带临时 URL

工作流程(每次执行前)

  1. 识别通道 → 按 api.md「场景路由」判断属于哪个通道
  2. 校验配置 → bash scripts/dt_helper.sh --get KEY 读取该通道所需键值
  3. 收集缺失项 → 一次性询问并 bash scripts/dt_helper.sh --set KEY=VALUE 写入
  4. 获取 Token → 机器人用 --token;工作通知用 --old-token;Webhook/sessionWebhook 无需
  5. 执行 API → 多行逻辑写入 /tmp/<task>.sh 再执行;禁止 heredoc

各通道所需配置

通道所需配置来源说明
WebhookDINGTALK_WEBHOOK_URL(加签额外需 DINGTALK_WEBHOOK_SECRET)群设置 → 智能群助手 → 添加自定义机器人
机器人消息DINGTALK_APP_KEY + DINGTALK_APP_SECRET开放平台 → 应用管理 → 凭证信息
工作通知DINGTALK_APP_KEY + DINGTALK_APP_SECRET + DINGTALK_AGENT_IDagentId 在应用管理 → 基本信息
  • robotCode = appKey(完全一致,无需额外配置)
  • 凭证禁止在输出中完整打印,确认时仅显示前 4 位 + ****
  • 消息内容缺失时:先询问用户想发什么,不要自行编造

Details

Repository
github.com/breath57/dingtalk-skills
Category
Email & Messaging
First seen
Apr 16, 2026

More from breath57/dingtalk-skills

All 6

Similar to Dingtalk Message

More Email & Messaging