← 返回 Skills 市场
shyzhen

dingtalk-send-media

作者 Ash · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
145
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install dingtalk-send-media
功能描述
发送钉钉媒体文件给用户或群聊。仅在用户明确要求把本地文件、截图、录音、视频、附件发送到钉钉,或当前上下文已明确是钉钉会话时使用。通过 `scripts/send_media.py` 执行,支持 image/voice/video/file 等。
使用说明 (SKILL.md)

\r \r

DingTalk Send Media\r

\r 使用同目录脚本 scripts/send_media.py 发送钉钉媒体消息。OpenClaw 不会自动执行目录中的 .py 文件;命中本 skill 后,应显式调用脚本。\r \r

触发场景\r

\r 在这些场景使用本 skill:\r \r

  • 用户要求把本地文件、图片、截图、录音、视频、压缩包发到钉钉\r
  • 用户要求发送给某个钉钉用户 ID,或发送到某个钉钉群 ID\r
  • 当前上下文已明确是钉钉账号或钉钉会话,且目标是“发送附件”\r \r 不要在这些场景使用本 skill:\r \r
  • 用户想编辑钉钉文档正文或知识库内容\r
  • 用户只说“发给他”但没有文件路径、目标 ID,且上下文无法补全\r
  • 与钉钉无关的发送场景,例如邮件附件、飞书文件、Slack 上传\r \r

运行前提\r

\r 脚本依赖 pythonpython3。\r \r 可用配置来源:\r \r

  1. 环境变量 DINGTALK_CLIENTID + DINGTALK_CLIENTSECRET,优先级最高\r
  2. openclaw.json 中的 channels.dingtalk.accounts\r
  3. openclaw.json 中的 channels.dingtalk-connector.accounts\r
  4. openclaw.json 中的 channels.dingtalk-connector 顶层凭证\r \r 相关环境变量:\r \r
  • DINGTALK_CLIENTID\r
  • DINGTALK_CLIENTSECRET\r
  • DINGTALK_ROBOTCODE\r
  • DINGTALK_CORPID\r
  • DINGTALK_AGENTID\r
  • OPENCLAW_AGENT_ID\r
  • OPENCLAW_ACCOUNT_ID\r
  • OPENCLAW_CONFIG\r \r

执行入口\r

\r 脚本文件:scripts/send_media.py\r \r 执行时使用绝对路径,形式如下:\r \r

python /absolute/path/to/scripts/send_media.py \x3Cfile-path> \x3Ctarget-id> [account-id] [media-type] [--group|--user] [--debug]\r
```\r
\r
在 Linux 或 macOS 上,如果只有 `python3`,使用:\r
\r
```bash\r
python3 /absolute/path/to/scripts/send_media.py \x3Cfile-path> \x3Ctarget-id> [account-id] [media-type] [--group|--user] [--debug]\r
```\r
\r
## 发送前检查\r
\r
执行前尽量确认这些信息:\r
\r
- 文件路径存在,且是本机可访问的绝对路径\r
- 目标 ID 是钉钉用户 ID,或以 `cid` 开头的群 ID\r
- 如果存在多个钉钉账号,确认应该使用哪个账号\r
- 如果用户没有指定媒体类型,可以让脚本自动检测\r
- 默认会将 `cid...` 自动识别为群聊;如需覆盖,可使用 `--group` 或 `--user`\r
\r
## 命令映射\r
\r
### 1. 自动检测账号并发送\r
\r
适用:\r
\r
- 当前只有一个账号\r
- 或者已能从 `OPENCLAW_AGENT_ID` / `OPENCLAW_ACCOUNT_ID` / bindings 推导账号\r
\r
执行:\r
\r
```bash\r
python /absolute/path/to/scripts/send_media.py \x3Cfile-path> \x3Ctarget-id>\r
```\r
\r
说明:\r
\r
- 若 `target-id` 以 `cid` 开头,脚本会自动按群聊发送\r
- 其他目标默认按单聊发送\r
\r
### 2. 指定账号发送\r
\r
适用:\r
\r
- 存在多个钉钉账号\r
- 用户明确要求用某个账号发送\r
\r
执行:\r
\r
```bash\r
python /absolute/path/to/scripts/send_media.py \x3Cfile-path> \x3Ctarget-id> \x3Caccount-id>\r
```\r
\r
### 3. 指定媒体类型发送\r
\r
适用:\r
\r
- 自动检测类型不可靠\r
- 用户明确要求按图片、语音、视频或普通文件发送\r
\r
执行:\r
\r
```bash\r
python /absolute/path/to/scripts/send_media.py \x3Cfile-path> \x3Ctarget-id> \x3Caccount-id-or-type> [media-type]\r
```\r
\r
媒体类型仅允许:\r
\r
- `image`\r
- `voice`\r
- `video`\r
- `file`\r
\r
### 4. 显式指定群聊或单聊\r
\r
适用:\r
\r
- 目标 ID 规则不稳定,不能只靠 `cid` 判断\r
- 你想覆盖自动检测结果\r
\r
执行:\r
\r
```bash\r
python /absolute/path/to/scripts/send_media.py \x3Cfile-path> \x3Ctarget-id> [account-id] [media-type] --group\r
python /absolute/path/to/scripts/send_media.py \x3Cfile-path> \x3Ctarget-id> [account-id] [media-type] --user\r
```\r
\r
### 5. 调试模式\r
\r
适用:\r
\r
- 账号检测或配置选择异常\r
\r
执行:\r
\r
```bash\r
python /absolute/path/to/scripts/send_media.py \x3Cfile-path> \x3Ctarget-id> --debug\r
```\r
\r
## 工作流程\r
\r
1. 确认目标是钉钉发送媒体,而不是文档编辑。\r
2. 提取文件路径和目标 ID。\r
3. 如有多个账号或上下文不明确,优先确认账号。\r
4. 执行脚本。\r
5. 若脚本返回 `ok: true`,向用户报告已发送的文件名、目标和账号。\r
6. 若脚本返回 `ok: false`,根据错误内容给出下一步说明。\r
\r
## 常见错误\r
\r
- `未找到 OpenClaw 配置文件 openclaw.json`:当前无配置文件,需提供环境变量凭证或配置文件\r
- `未找到钉钉账号配置`:账号自动检测失败,需显式指定账号或补齐配置\r
- `获取 access token 失败`:检查 `clientId` / `clientSecret`\r
- `上传媒体文件失败`:检查文件路径、大小、媒体类型和上传权限\r
- `发送消息失败`:检查目标用户 ID / 群 ID、机器人权限和 `robotCode`\r
\r
## 限制\r
\r
- 本 skill 用于发送媒体,不用于编辑钉钉文档内容\r
- 需要本机已有可发送的文件路径\r
- 群聊发送要求目标是合法 `cid...`\r
- 多账号场景下,若无法唯一推导账号,可能需要显式传入 `account-id`\r
\r
## 参考\r
\r
- 人工说明文档:`README.md`\r
- 实际执行脚本:`scripts/send_media.py`
安全使用建议
This skill appears coherent and limited to sending local files to DingTalk. Before installing or allowing autonomous use: (1) review scripts/send_media.py yourself to confirm behavior, (2) be aware it will load ~/.openclaw/openclaw.json (or the path in OPENCLAW_CONFIG) to autodetect accounts — that file can include other credentials, so consider using DINGTALK_CLIENTID/DINGTALK_CLIENTSECRET env vars if you prefer not to expose the whole config, (3) confirm you trust the skill's source before letting it upload potentially sensitive files, and (4) avoid running it with elevated privileges or exposing unrelated secrets in the OpenClaw config.
功能分析
Type: OpenClaw Skill Name: dingtalk-send-media Version: 1.0.1 The skill 'dingtalk-send-media' is designed to send local media files to DingTalk users or groups. The core logic in `scripts/send_media.py` uses standard Python libraries to interact with official DingTalk API endpoints (api.dingtalk.com and oapi.dingtalk.com). It handles sensitive credentials (client IDs and secrets) from environment variables or the OpenClaw configuration file in a standard manner. No evidence of data exfiltration to unauthorized domains, malicious execution, or hidden backdoors was found; the script's behavior aligns perfectly with its stated purpose.
能力标签
requires-oauth-token
能力评估
Purpose & Capability
Name/description match the implementation: the skill provides a Python script that reads local file paths and sends them to DingTalk APIs. The account-detection logic (env vars, openclaw.json, bindings) is consistent with the stated goal of supporting multiple config sources.
Instruction Scope
SKILL.md limits use to explicit media-sending scenarios and instructs explicit invocation of scripts. The script reads ~/.openclaw/openclaw.json (or OPENCLAW_CONFIG) and several environment variables to locate DingTalk credentials — this is necessary for account detection, but it does mean the skill will load the user's OpenClaw config (which may contain other channel settings). The instructions do not ask to read unrelated files beyond that config.
Install Mechanism
No install spec; instruction-only plus a bundled Python script. No network-based installers, no external download URLs, and only standard-library Python usage are present in the package metadata and README.
Credentials
The env vars referenced (DINGTALK_CLIENTID, DINGTALK_CLIENTSECRET, DINGTALK_ROBOTCODE, OPENCLAW_AGENT_ID, OPENCLAW_ACCOUNT_ID, OPENCLAW_CONFIG, etc.) are relevant to DingTalk/OpenClaw operation. The skill does read the OpenClaw config file which can contain other channel credentials — this is explainable by the account autodetection feature, but users should be aware the script accesses that file if present.
Persistence & Privilege
always:false and normal model invocation settings. The skill does not request persistent installation or modify other skills; it is invoked explicitly per the SKILL.md guidance.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dingtalk-send-media
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dingtalk-send-media 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added cached bytecode file scripts/__pycache__/send_media.cpython-314.pyc for improved Python module management. - Updated SKILL.md to: clarify the intended usage scenarios, specify all environment variables and config entry points in a concise way, document supported script arguments and platform differences, and remove detailed multi-page user instructions to focus on automation interface usage. - Documentation now emphasizes precise conditions for when to use (and when NOT to use) this skill, with clear examples and error handling guidance. - Added concise sections on command variants, debugging mode, and limitations for multi-account or ambiguous context cases.
v1.0.0
Initial release of dingtalk-send-media: Send images, voice, video, or files to DingTalk users or groups, with robust auto-detection of account credentials. - Supports automatic DingTalk account detection based on OPENCLAW_AGENT_ID, OPENCLAW_ACCOUNT_ID, bindings, or environment variables. - Zero external dependencies: Only Python standard library needed; works on Windows, Linux, and macOS. - Multimedia support: Automatically recognizes image, voice, video, and file types; ensures correct file name display. - Environment variable override: Credentials (DINGTALK_CLIENTID/SECRET) can be set via .env or environment for secure deployment and dynamic switching. - Includes troubleshooting tips, real-world usage examples, and full documentation in SKILL.md.
元数据
Slug dingtalk-send-media
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

dingtalk-send-media 是什么?

发送钉钉媒体文件给用户或群聊。仅在用户明确要求把本地文件、截图、录音、视频、附件发送到钉钉,或当前上下文已明确是钉钉会话时使用。通过 `scripts/send_media.py` 执行,支持 image/voice/video/file 等。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 145 次。

如何安装 dingtalk-send-media?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install dingtalk-send-media」即可一键安装,无需额外配置。

dingtalk-send-media 是免费的吗?

是的,dingtalk-send-media 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

dingtalk-send-media 支持哪些平台?

dingtalk-send-media 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 dingtalk-send-media?

由 Ash(@shyzhen)开发并维护,当前版本 v1.0.1。

💬 留言讨论