---
name: ding-skills
version: 1.0.0
category: 职场效率
trigger_words:
tags:
  - meeting
platform: coze
source: DeepseekModel
source_url: https://deepseekmodel.com/skill?id=leoyeai-openclaw-master-skills-skills-ding-skills-skill-md
---

name ding-skills description 钉钉操作助手（DingTalk）。当用户通过钉钉对话、或提到以下任何场景时必须使用此技能：查人（查下某某、搜一下某人、找一下谁谁）、查部门、查手机号、查工号、约会议（预约会议、创建会议、安排会议、开个会）、发消息（给某人发消息、群里发个通知）、查审批（我的审批、待审批、审批状态）、发起审批、同意/拒绝审批、查日程、创建日程、查员工数、查离职、开视频会议、钉钉知识库（查钉钉知识库、在钉钉创建文档、搜索钉钉文档、覆写钉钉文档）。注意：当用户从钉钉渠道发送消息时，"知识库"默认指钉钉知识库，不是飞书知识库。Use when user mentions anything about DingTalk or when the message comes from a DingTalk channel: looking up people, searching users/departments, scheduling meetings, creating conferences, sending messages, managing approvals, checking calendar events, querying employee info, DingTalk knowledge base operations (list workspaces, create/search/overwrite documents). When user is on DingTalk channel, "知识库" means DingTalk knowledge base, NOT Feishu. Ding Skills 钉钉全功能技能集：用户管理、部门管理、消息发送、OA审批、视频会议、日程管理。 前置要求 已设置环境变量 DINGTALK_APP_KEY 和 DINGTALK_APP_SECRET 钉钉应用已创建并拥有相应 API 权限 环境变量配置 export DINGTALK_APP_KEY= "<your-app-key>" export DINGTALK_APP_SECRET= "<your-app-secret>" export DINGTALK_ROBOT_CODE= "<your-robot-code>" # 可选，发消息时使用 重要：常用工作流（必读） 大部分钉钉 API 需要 userId 或 unionId ，但用户通常只会说人名。 遇到人名时，必须先查人再执行操作。 工作流1：按人名预约会议 / 创建视频会议 当用户说"帮我和张三、李四开个会"或"预约一个会议，参会人：张三、李四"时： 步骤1: python scripts/search_user.py "张三" → 得到 userId 步骤2: python scripts/get_user.py "<userId>" → 得到 unionId 步骤3: 对每个参会人重复步骤1-2 步骤4: python scripts/create_schedule_conference.py "<主题>" "<发起人unionId>" "<开始时间>" "<结束时间>" "<参会人unionId1,unionId2>" "[会议地点]" 工作流2：按人名发消息 当用户说"给张三发个消息"时： 步骤1: python scripts/search_user.py "张三" → 得到 userId 步骤2: python scripts/send_user_message.py "<userId>" "<消息内容>" 注意：robotCode 自动从环境变量 DINGTALK_ROBOT_CODE 读取，也可作为第3个参数手动传入。 工作流3：按人名查审批 当用户说"查下张三的待审批"时： 步骤1: python scripts/search_user.py "张三" → 得到 userId 步骤2: python scripts/list_user_todo_approvals.py "<userId>" 工作流4：按人名查日程 当用户说"查下张三今天的日程"时： 步骤1: python scripts/search_user.py "张三" → 得到 userId 步骤2: python scripts/get_user.py "<userId>" → 得到 unionId 步骤3: python scripts/list_events.py "<unionId>" "[开始时间]" "[结束时间]" 工作流5：在知识库中创建文档 当用户说"在知识库里创建一个文档"时： 步骤1: python scripts/search_user.py "张三" → 得到 userId 步骤2: python scripts/get_user.py "<userId>" → 得到 unionId 步骤3: python scripts/list_workspaces.py "<unionId>" → 得到 workspaceId 步骤4: python scripts/create_doc.py "<workspaceId>" "<文档名>" "<unionId>" 工作流6：搜索知识库文档获取链接 当用户说"帮我找一下知识库里的《周报》"时： 步骤1: python scripts/search_user.py "张三" → 得到 userId 步骤2: python scripts/get_user.py "<userId>" → 得到 unionId 步骤3: python scripts/search_doc.py "<unionId>" "周报" → 得到文档链接 通用规则 用户说人名 → 必须先调用 search_user.py 获取 userId 需要 unionId 的 API （日历、会议相关） → 再调用 get_user.py 从 userId 获取 unionId 需要 userId 的 API （消息、审批、部门相关） → search_user.py 的结果可直接使用 可以并行查询 多个用户以提高效率 功能列表 1. 搜索用户 (search-user) 根据姓名搜索用户，返回匹配的 UserId 列表。 python scripts/search_user.py "<搜索关键词>" 输出： { "success" : true , "keyword" : "张三" , "totalCount" : 3 , "hasMore" : false , "userIds" : [ "123456789" , "987654321" ] } 2. 查询用户详情 (get-user) 获取指定用户的详细信息。 python scripts/get_user.py "<userId>" 输出： { "success" : true , "user" : { "userid" : "user001" , "name" : "张三" , "mobile" : "138****1234" , "dept_id_list" : [ 12345 ] , "unionid" : "xxxxx" } } 3. 根据手机号查询用户 (get-user-by-mobile) python scripts/get_user_by_mobile.py "<手机号>" 输出： { "success" : true , "mobile" : "13800138000" , "userId" : "user001" } 4. 根据 unionid 查询用户 (get-user-by-unionid) python scripts/get_user_by_unionid.py "<unionid>" 输出： { "success" : true , "unionid" : "xxxxx" , "userId" : "user001" } 5. 获取员工人数 (get-user-count) python scripts/get_user_count.py [--onlyActive] 输出： { "success" : true , "onlyActive" : false , "count" : 150 } 6. 获取用户待审批数量 (get-user-todo-count) python scripts/get_user_todo_count.py "<userId>" 输出： { "success" : true , "userId" : "user001" , "count" : 5 } 7. 获取未登录用户列表 (list-inactive-users) python scripts/list_inactive_users.py "<queryDate>" [--deptIds "id1,id2" ] [--offset 0] [--size 100] queryDate 格式: yyyyMMdd 输出： { "success" : true , "queryDate" : "20240115" , "userIds" : [ "user001" ] , "hasMore" : false } 8. 查询离职记录列表 (list-resigned-users) python scripts/list_resigned_users.py "<startTime>" [ "<endTime>" ] [--nextToken "xxx" ] [--maxResults 100] startTime/endTime 格式: ISO8601 输出： { "success" : true , "startTime" : "2024-01-01T00:00:00+08:00" , "records" : [ { "userId" : "user001" , "name" : "张三" , "leaveTime" : "2024-01-15T10:00:00Z" } ] } 9. 搜索部门 (search-department) python scripts/search_department.py "<搜索关键词>" 输出： { "success" : true , "keyword" : "技术部" , "totalCount" : 2 , "departmentIds" : [ 12345 , 67890 ] } 10. 获取部门详情 (get-department) python scripts/get_department.py "<deptId>" 输出： { "success" : true , "department" : { "deptId" : 12345 , "name" : "技术部" , "parentId" : 1 } } 11. 获取子部门列表 (list-sub-departments) 根部门 deptId = 1。 python scripts/list_sub_departments.py "<deptId>" 输出： { "success" : true , "deptId" : 1 , "subDepartmentIds" : [ 12345 , 67890 ] } 12. 获取部门用户列表 (list-department-users) 自动分页获取所有用户（简略信息）。 python scripts/list_department_users.py "<deptId>" 输出： { "success" : true , "deptId" : 12345 , "users" : [ { "userId" : "user001" , "name" : "张三" } , { "userId" : "user002" , "name" : "李四" } ] } 13. 获取部门用户详情 (list-department-user-details) 分页获取，支持 cursor 和 size。 python scripts/list_department_user_details.py "<deptId>" [--cursor 0] [--size 100] 输出： { "success" : true , "deptId" : 12345 , "users" : [ ... ] , "hasMore" : true , "nextCursor" : 100 } 14. 获取部门用户 ID 列表 (list-department-user-ids) python scripts/list_department_user_ids.py "<deptId>" 输出： { "success" : true , "deptId" : 12345 , "userIds" : [ "user001" , "user002" ] } 15. 获取部门父部门链 (list-department-parents) python scripts/list_department_parents.py "<deptId>" 输出： { "success" : true , "deptId" : 12345 , "parentIdList" : [ 12345 , 67890 , 1 ] } 16. 获取用户所属部门父部门链 (list-user-parent-departments) python scripts/list_user_parent_departments.py "<userId>" 输出： { "success" : true , "userId" : "user001" , "parentIdList" : [ 12345 , 1 ] } 17. 获取群内机器人列表 (get-bot-list) python scripts/get_bot_list.py "<openConversationId>" 输出： { "success" : true , "openConversationId" : "cid" , "botList" : [ { "robotCode" : "code" , "robotName" : "name" } ] } 18. 机器人发送群消息 (send-group-message) robotCode 自动从环境变量 DINGTALK_ROBOT_CODE 读取，也可作为第3个参数手动传入。 python scripts/send_group_message.py "<openConversationId>" "<消息内容>" [ "<robotCode>" ] 输出： { "success" : true , "openConversationId" : "cid" , "robotCode" : "code" , "processQueryKey" : "key" , "message" : "消息内容" } 19. 机器人发送单聊消息 (send-user-message) robotCode 自动从环境变量 DINGTALK_ROBOT_CODE 读取，也可作为第3个参数手动传入。 python scripts/send_user_message.py "<userId>" "<消息内容>" [ "<robotCode>" ] 输出： { "success" : true , "userId" : "user001" , "robotCode" : "code" , "processQueryKey" : "key" , "message" : "消息内容" } 20. 获取审批实例 ID 列表 (list-approval-instance-ids) python scripts/list_approval_instance_ids.py "<processCode>" --startTime <timestamp> --endTime <timestamp> [--size 20] [--nextToken "xxx" ] 输出： { "success" : true , "processCode" : "PROC-XXX" , "instanceIds" : [ "id1" , "id2" ] , "totalCount" : 2 , "hasMore" : false } 21. 获取审批实例详情 (get-approval-instance) python scripts/get_approval_instance.py "<instanceId>" 输出： { "success" : true , "instanceId" : "xxx-123" , "instance" : { "processInstanceId" : "xxx-123" , "title" : "请假申请" , "status" : "COMPLETED" , "formComponentValues" : [ ... ] , "tasks" : [ ... ] } } 22. 查询用户发起的审批 (list-user-initiated-approvals)