Install
openclaw skills install dingtalk-send-media发送钉钉媒体文件给用户或群聊。仅在用户明确要求把本地文件、截图、录音、视频、附件发送到钉钉,或当前上下文已明确是钉钉会话时使用。通过 `scripts/send_media.py` 执行,支持 image/voice/video/file 等。
openclaw skills install dingtalk-send-media使用同目录脚本 scripts/send_media.py 发送钉钉媒体消息。OpenClaw 不会自动执行目录中的 .py 文件;命中本 skill 后,应显式调用脚本。
在这些场景使用本 skill:
不要在这些场景使用本 skill:
脚本依赖 python 或 python3。
可用配置来源:
DINGTALK_CLIENTID + DINGTALK_CLIENTSECRET,优先级最高openclaw.json 中的 channels.dingtalk.accountsopenclaw.json 中的 channels.dingtalk-connector.accountsopenclaw.json 中的 channels.dingtalk-connector 顶层凭证相关环境变量:
DINGTALK_CLIENTIDDINGTALK_CLIENTSECRETDINGTALK_ROBOTCODEDINGTALK_CORPIDDINGTALK_AGENTIDOPENCLAW_AGENT_IDOPENCLAW_ACCOUNT_IDOPENCLAW_CONFIG脚本文件:scripts/send_media.py
执行时使用绝对路径,形式如下:
python /absolute/path/to/scripts/send_media.py <file-path> <target-id> [account-id] [media-type] [--group|--user] [--debug]
在 Linux 或 macOS 上,如果只有 python3,使用:
python3 /absolute/path/to/scripts/send_media.py <file-path> <target-id> [account-id] [media-type] [--group|--user] [--debug]
执行前尽量确认这些信息:
cid 开头的群 IDcid... 自动识别为群聊;如需覆盖,可使用 --group 或 --user适用:
OPENCLAW_AGENT_ID / OPENCLAW_ACCOUNT_ID / bindings 推导账号执行:
python /absolute/path/to/scripts/send_media.py <file-path> <target-id>
说明:
target-id 以 cid 开头,脚本会自动按群聊发送适用:
执行:
python /absolute/path/to/scripts/send_media.py <file-path> <target-id> <account-id>
适用:
执行:
python /absolute/path/to/scripts/send_media.py <file-path> <target-id> <account-id-or-type> [media-type]
媒体类型仅允许:
imagevoicevideofile适用:
cid 判断执行:
python /absolute/path/to/scripts/send_media.py <file-path> <target-id> [account-id] [media-type] --group
python /absolute/path/to/scripts/send_media.py <file-path> <target-id> [account-id] [media-type] --user
适用:
执行:
python /absolute/path/to/scripts/send_media.py <file-path> <target-id> --debug
ok: true,向用户报告已发送的文件名、目标和账号。ok: false,根据错误内容给出下一步说明。未找到 OpenClaw 配置文件 openclaw.json:当前无配置文件,需提供环境变量凭证或配置文件未找到钉钉账号配置:账号自动检测失败,需显式指定账号或补齐配置获取 access token 失败:检查 clientId / clientSecret上传媒体文件失败:检查文件路径、大小、媒体类型和上传权限发送消息失败:检查目标用户 ID / 群 ID、机器人权限和 robotCodecid...account-idREADME.mdscripts/send_media.py