@dingtalk-real-ai/dingtalk-connector 0.8.21 → 0.8.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/bin/dingtalk-connector.js +20 -3
- package/dist/entry-bundled.mjs +1 -1
- package/dist/{gateway-methods-BNuB2wXl.mjs → gateway-methods-C3nEHxL4.mjs} +2 -2
- package/dist/gateway-methods-COXVcCFs.mjs +2 -0
- package/dist/index.mjs +2 -2
- package/dist/{media-BRqGsKUB.mjs → media-BViJQGgb.mjs} +8 -8
- package/dist/{media-DD7Rlljd.mjs → media-CIO05hZn.mjs} +1 -1
- package/dist/{message-handler-CPGT1bgU.mjs → message-handler-0NLKAqHU.mjs} +7 -7
- package/dist/{messaging-DQwrrd68.mjs → messaging-C2zJ8O-o.mjs} +5 -5
- package/dist/{runtime-BphH7_vR.mjs → runtime-BCFW2-1B.mjs} +4 -4
- package/dist/{utils-QEvgZ2uM.mjs → utils-DgNm1Ek_.mjs} +7 -5
- package/dist/{utils-BqUoUOwd.mjs → utils-TpPdfqWr.mjs} +1 -1
- package/docs/RELEASE_NOTES_V0.8.22-beta.0.md +107 -0
- package/docs/RELEASE_NOTES_V0.8.22.md +95 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/core/message-handler.ts +2 -1
- package/src/reply-dispatcher.ts +3 -2
- package/src/utils/empty-reply.ts +7 -5
- package/dist/gateway-methods-B0_tBGPn.mjs +0 -2
- package/skills/dingtalk-channel-rules/SKILL.md +0 -91
- package/skills/dingtalk-troubleshoot/SKILL.md +0 -93
- package/skills/dws-cli/SKILL.md +0 -129
- package/skills/dws-cli/references/error-codes.md +0 -95
- package/skills/dws-cli/references/field-rules.md +0 -105
- package/skills/dws-cli/references/global-reference.md +0 -104
- package/skills/dws-cli/references/intent-guide.md +0 -114
- package/skills/dws-cli/references/products/aitable.md +0 -452
- package/skills/dws-cli/references/products/attendance.md +0 -93
- package/skills/dws-cli/references/products/calendar.md +0 -217
- package/skills/dws-cli/references/products/chat.md +0 -292
- package/skills/dws-cli/references/products/contact.md +0 -108
- package/skills/dws-cli/references/products/ding.md +0 -57
- package/skills/dws-cli/references/products/report.md +0 -162
- package/skills/dws-cli/references/products/simple.md +0 -128
- package/skills/dws-cli/references/products/todo.md +0 -138
- package/skills/dws-cli/references/products/workbench.md +0 -39
- package/skills/dws-cli/references/recovery-guide.md +0 -94
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
# 日历 (calendar) 命令参考
|
|
2
|
-
|
|
3
|
-
## 命令总览
|
|
4
|
-
|
|
5
|
-
### 查询日程列表
|
|
6
|
-
```
|
|
7
|
-
Usage:
|
|
8
|
-
dws calendar event list [flags]
|
|
9
|
-
Example:
|
|
10
|
-
dws calendar event list --start "2026-03-10T14:00:00+08:00" --end "2026-03-10T18:00:00+08:00"
|
|
11
|
-
Flags:
|
|
12
|
-
--end string 结束时间 ISO-8601 (例如 2026-03-10T18:00:00+08:00)
|
|
13
|
-
--start string 开始时间 ISO-8601 (例如 2026-03-10T14:00:00+08:00)
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### 获取日程详情
|
|
17
|
-
```
|
|
18
|
-
Usage:
|
|
19
|
-
dws calendar event get [flags]
|
|
20
|
-
Example:
|
|
21
|
-
dws calendar event get --id <EVENT_ID>
|
|
22
|
-
Flags:
|
|
23
|
-
--id string 日程 ID (必填)
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### 创建日程
|
|
27
|
-
```
|
|
28
|
-
Usage:
|
|
29
|
-
dws calendar event create [flags]
|
|
30
|
-
Example:
|
|
31
|
-
dws calendar event create --title "Q1 复盘会" \
|
|
32
|
-
--start "2026-03-10T14:00:00+08:00" --end "2026-03-10T15:00:00+08:00"
|
|
33
|
-
Flags:
|
|
34
|
-
--desc string 日程描述
|
|
35
|
-
--end string 结束时间 ISO-8601 (必填)
|
|
36
|
-
--start string 开始时间 ISO-8601 (必填)
|
|
37
|
-
--title string 日程标题 (必填)
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### 修改日程
|
|
41
|
-
```
|
|
42
|
-
Usage:
|
|
43
|
-
dws calendar event update [flags]
|
|
44
|
-
Example:
|
|
45
|
-
dws calendar event update --id <EVENT_ID> --title "新标题"
|
|
46
|
-
Flags:
|
|
47
|
-
--end string 新结束时间
|
|
48
|
-
--id string 日程 ID (必填)
|
|
49
|
-
--start string 新开始时间
|
|
50
|
-
--title string 新标题
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### 删除日程
|
|
54
|
-
```
|
|
55
|
-
Usage:
|
|
56
|
-
dws calendar event delete [flags]
|
|
57
|
-
Example:
|
|
58
|
-
dws calendar event delete --id <EVENT_ID> --yes
|
|
59
|
-
Flags:
|
|
60
|
-
--id string 日程 ID (必填)
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### 查看参与者
|
|
64
|
-
```
|
|
65
|
-
Usage:
|
|
66
|
-
dws calendar participant list [flags]
|
|
67
|
-
Example:
|
|
68
|
-
dws calendar participant list --event <EVENT_ID>
|
|
69
|
-
Flags:
|
|
70
|
-
--event string 日程 ID (必填)
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### 添加参与者
|
|
74
|
-
```
|
|
75
|
-
Usage:
|
|
76
|
-
dws calendar participant add [flags]
|
|
77
|
-
Example:
|
|
78
|
-
dws calendar participant add --event <EVENT_ID> --users <USER_ID_1>,<USER_ID_2>
|
|
79
|
-
Flags:
|
|
80
|
-
--event string 日程 ID (必填)
|
|
81
|
-
--users string 用户 ID 列表 (必填)
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### 移除参与者
|
|
85
|
-
```
|
|
86
|
-
Usage:
|
|
87
|
-
dws calendar participant delete [flags]
|
|
88
|
-
Example:
|
|
89
|
-
dws calendar participant delete --event <EVENT_ID> --users <USER_ID> --yes
|
|
90
|
-
Flags:
|
|
91
|
-
--event string 日程 ID (必填)
|
|
92
|
-
--users string 用户 ID 列表 (必填)
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### 搜索会议室
|
|
96
|
-
```
|
|
97
|
-
Usage:
|
|
98
|
-
dws calendar room search [flags]
|
|
99
|
-
Example:
|
|
100
|
-
dws calendar room search --start "2026-03-10T14:00:00+08:00" --end "2026-03-10T15:00:00+08:00" --available
|
|
101
|
-
dws calendar room search --start "2026-03-10T14:00:00+08:00" --end "2026-03-10T15:00:00+08:00" --group-id <GROUP_ID>
|
|
102
|
-
Flags:
|
|
103
|
-
--available 仅查空闲会议室
|
|
104
|
-
--end string 结束时间 ISO-8601 (必填)
|
|
105
|
-
--group-id string 会议室分组ID(可选,留空查根目录;超100条时需按分组查询)
|
|
106
|
-
--start string 开始时间 ISO-8601 (必填)
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### 预定会议室
|
|
110
|
-
```
|
|
111
|
-
Usage:
|
|
112
|
-
dws calendar room add [flags]
|
|
113
|
-
Example:
|
|
114
|
-
dws calendar room add --event <EVENT_ID> --rooms <ROOM_ID>
|
|
115
|
-
Flags:
|
|
116
|
-
--event string 日程 ID (必填)
|
|
117
|
-
--rooms string 会议室 ID 列表 (必填)
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### 移除会议室
|
|
121
|
-
```
|
|
122
|
-
Usage:
|
|
123
|
-
dws calendar room delete [flags]
|
|
124
|
-
Example:
|
|
125
|
-
dws calendar room delete --event <EVENT_ID> --rooms <ROOM_ID> --yes
|
|
126
|
-
Flags:
|
|
127
|
-
--event string 日程 ID (必填)
|
|
128
|
-
--rooms string 会议室 ID 列表 (必填)
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### 会议室分组列表
|
|
132
|
-
```
|
|
133
|
-
Usage:
|
|
134
|
-
dws calendar room list-groups [flags]
|
|
135
|
-
Example:
|
|
136
|
-
dws calendar room list-groups
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### 查询用户闲忙状态
|
|
140
|
-
```
|
|
141
|
-
Usage:
|
|
142
|
-
dws calendar busy search [flags]
|
|
143
|
-
Example:
|
|
144
|
-
dws calendar busy search --users <USER_ID_1>,<USER_ID_2> \
|
|
145
|
-
--start "2026-03-10T14:00:00+08:00" --end "2026-03-10T18:00:00+08:00"
|
|
146
|
-
Flags:
|
|
147
|
-
--end string 结束时间 ISO-8601 (必填)
|
|
148
|
-
--start string 开始时间 ISO-8601 (必填)
|
|
149
|
-
--users string 用户 ID 列表 (必填)
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
## 意图判断
|
|
153
|
-
|
|
154
|
-
用户说"日程/会议/约会/日历":
|
|
155
|
-
- 查看 → `event list`
|
|
156
|
-
- 详情 → `event get`
|
|
157
|
-
- 创建/约 → `event create`
|
|
158
|
-
- 修改/改时间 → `event update`
|
|
159
|
-
- 取消/删除 → `event delete`
|
|
160
|
-
|
|
161
|
-
用户说"参会人/与会者":
|
|
162
|
-
- 查看 → `participant list`
|
|
163
|
-
- 邀请/添加 → `participant add`
|
|
164
|
-
- 移除 → `participant delete`
|
|
165
|
-
|
|
166
|
-
用户说"会议室/订会议室":
|
|
167
|
-
- 哪个空闲 → `room search`
|
|
168
|
-
- 预定 → `room add`
|
|
169
|
-
- 取消预定 → `room delete`
|
|
170
|
-
- 分组 → `room list-groups`,取 groupId 后 `room search --group-id`
|
|
171
|
-
|
|
172
|
-
用户说"有空吗/忙不忙/闲忙":
|
|
173
|
-
- 查询 → `busy search`
|
|
174
|
-
|
|
175
|
-
## 核心工作流
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
# 1. 创建日程 — 提取 eventId
|
|
179
|
-
dws calendar event create --title "Q1 复盘会" \
|
|
180
|
-
--start "2026-03-10T14:00:00+08:00" --end "2026-03-10T15:00:00+08:00" --format json
|
|
181
|
-
|
|
182
|
-
# 2. 添加参与者
|
|
183
|
-
dws calendar participant add --event <EVENT_ID> --users userId1,userId2 --format json
|
|
184
|
-
|
|
185
|
-
# 3. 预定会议室 (先搜空闲)
|
|
186
|
-
dws calendar room search --start "2026-03-10T14:00:00+08:00" --end "2026-03-10T15:00:00+08:00" --format json
|
|
187
|
-
# 若返回错误(会议室超100条),先查分组再按分组搜索:
|
|
188
|
-
# dws calendar room list-groups --format json
|
|
189
|
-
# dws calendar room search --start ... --end ... --group-id <GROUP_ID> --format json
|
|
190
|
-
dws calendar room add --event <EVENT_ID> --rooms <ROOM_ID> --format json
|
|
191
|
-
|
|
192
|
-
# 4. 查看日程列表
|
|
193
|
-
dws calendar event list --start "2026-03-10T14:00:00+08:00" --end "2026-03-10T15:00:00+08:00" --format json
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## 上下文传递表
|
|
197
|
-
|
|
198
|
-
| 操作 | 从返回中提取 | 用于 |
|
|
199
|
-
|------|-------------|------|
|
|
200
|
-
| `event create` | `eventId` | participant/room 操作的 --event |
|
|
201
|
-
| `event list` | `events[].eventId` | event get/update/delete 的 --id |
|
|
202
|
-
| `room search` | `rooms[].roomId` | room add 的 --rooms |
|
|
203
|
-
| `room list-groups` | `groups[].groupId` | room search 的 --group-id |
|
|
204
|
-
|
|
205
|
-
## 注意事项
|
|
206
|
-
|
|
207
|
-
- 时间格式: `event create/update`、`event list` 和 `busy search` 用 ISO-8601
|
|
208
|
-
- 创建日程不会自动预定会议室,需额外 `room add`
|
|
209
|
-
- `room search` 不带 `--group-id` 时查根目录;企业会议室超过 100 条会报错,此时需先 `room list-groups` 获取分组,再按分组逐一查询
|
|
210
|
-
|
|
211
|
-
## 自动化脚本
|
|
212
|
-
|
|
213
|
-
| 脚本 | 场景 | 用法 |
|
|
214
|
-
|------|------|------|
|
|
215
|
-
| [calendar_today_agenda.py](../../scripts/calendar_today_agenda.py) | 查看今天/明天/本周日程安排 | `python calendar_today_agenda.py today` |
|
|
216
|
-
| [calendar_schedule_meeting.py](../../scripts/calendar_schedule_meeting.py) | 一键创建日程+添加参与者+预定会议室 | `python calendar_schedule_meeting.py --title "复盘会" --start "2026-03-15T14:00" --end "2026-03-15T15:00" --users userId1 --book-room` |
|
|
217
|
-
| [calendar_free_slot_finder.py](../../scripts/calendar_free_slot_finder.py) | 查询多人共同空闲时段 | `python calendar_free_slot_finder.py --users userId1,userId2 --date 2026-03-15` |
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
# 群聊与机器人 (chat) 命令参考
|
|
2
|
-
|
|
3
|
-
## 命令总览
|
|
4
|
-
|
|
5
|
-
| 子命令 | 用途 |
|
|
6
|
-
|-------|------|
|
|
7
|
-
| `search` | 搜索群聊 |
|
|
8
|
-
| `group create` | 创建群 |
|
|
9
|
-
| `group members list` | 查看群成员列表 |
|
|
10
|
-
| `group members add` | 添加群成员 |
|
|
11
|
-
| `group members remove` | 移除群成员(⚠️ 危险操作) |
|
|
12
|
-
| `group members add-bot` | 添加机器人到群 |
|
|
13
|
-
| `group rename` | 修改群名称 |
|
|
14
|
-
| `bot search` | 搜索我的机器人 |
|
|
15
|
-
| `message send-by-bot` | 机器人发消息(群聊或批量单聊) |
|
|
16
|
-
| `message recall-by-bot` | 机器人撤回消息(群聊或批量单聊) |
|
|
17
|
-
| `message send-by-webhook` | 自定义机器人 Webhook 发消息 |
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## search — 搜索群聊
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
Usage:
|
|
25
|
-
dws chat search [flags]
|
|
26
|
-
Example:
|
|
27
|
-
dws chat search --query "项目冲刺" --format json
|
|
28
|
-
Flags:
|
|
29
|
-
--query string 搜索关键词 (必填)
|
|
30
|
-
--cursor string 分页游标(首页留空)
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## group create — 创建群
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
Usage:
|
|
39
|
-
dws chat group create [flags]
|
|
40
|
-
Example:
|
|
41
|
-
dws chat group create --name "Q1 项目冲刺群" --users userId1,userId2,userId3 --format json
|
|
42
|
-
Flags:
|
|
43
|
-
--name string 群名称 (必填)
|
|
44
|
-
--users string 群成员 userId 列表,逗号分隔 (必填)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
> 当前用户自动作为群主加入,无需在 --users 中重复传入。
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## group members list — 查看群成员列表
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
Usage:
|
|
55
|
-
dws chat group members list [flags]
|
|
56
|
-
Example:
|
|
57
|
-
dws chat group members list --id <openConversationId> --format json
|
|
58
|
-
Flags:
|
|
59
|
-
--id string 群会话 ID (必填)
|
|
60
|
-
--cursor string 分页游标
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## group members add — 添加群成员
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
Usage:
|
|
69
|
-
dws chat group members add [flags]
|
|
70
|
-
Example:
|
|
71
|
-
dws chat group members add --id <openConversationId> --users userId1,userId2 --format json
|
|
72
|
-
Flags:
|
|
73
|
-
--id string 群会话 ID (必填)
|
|
74
|
-
--users string 要添加的 userId 列表,逗号分隔 (必填)
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## group members remove — 移除群成员
|
|
80
|
-
|
|
81
|
-
> ⚠️ 危险操作:执行前必须向用户确认,同意后才加 `--yes`。
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
Usage:
|
|
85
|
-
dws chat group members remove [flags]
|
|
86
|
-
Example:
|
|
87
|
-
dws chat group members remove --id <openConversationId> --users userId1,userId2 --format json
|
|
88
|
-
Flags:
|
|
89
|
-
--id string 群会话 ID (必填)
|
|
90
|
-
--users string 要移除的 userId 列表,逗号分隔 (必填)
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## group members add-bot — 添加机器人到群
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
Usage:
|
|
99
|
-
dws chat group members add-bot [flags]
|
|
100
|
-
Example:
|
|
101
|
-
dws chat group members add-bot --id <openConversationId> --robot-code <robotCode> --format json
|
|
102
|
-
Flags:
|
|
103
|
-
--id string 群会话 ID (必填)
|
|
104
|
-
--robot-code string 机器人 code (必填)
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## group rename — 修改群名称
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
Usage:
|
|
113
|
-
dws chat group rename [flags]
|
|
114
|
-
Example:
|
|
115
|
-
dws chat group rename --id <openConversationId> --name "新群名" --format json
|
|
116
|
-
Flags:
|
|
117
|
-
--id string 群会话 ID (必填)
|
|
118
|
-
--name string 新群名称 (必填)
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## bot search — 搜索我的机器人
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
Usage:
|
|
127
|
-
dws chat bot search [flags]
|
|
128
|
-
Example:
|
|
129
|
-
dws chat bot search --name "考勤" --format json
|
|
130
|
-
Flags:
|
|
131
|
-
--name string 机器人名称(模糊搜索)
|
|
132
|
-
--page int 页码(默认 1)
|
|
133
|
-
--size int 每页数量(默认 50)
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## message send-by-bot — 机器人发消息
|
|
139
|
-
|
|
140
|
-
支持两种模式:群聊发送 和 批量单聊发送,通过 `--group` 和 `--users` 互斥区分。
|
|
141
|
-
|
|
142
|
-
> ⚠️ **多机器人场景必须传 `--client-id`**:当配置了多个机器人账号时,必须通过 `--client-id` 显式指定使用哪个机器人的凭据发送消息。`--client-id` 的值就是当前对话机器人的 clientId(即 DingTalk AppKey),可从会话上下文的 `AccountId` 对应的配置中获取。**如果不传 `--client-id`,dws 会使用默认登录的机器人凭据,可能导致"串台"——用错误的机器人身份发送消息。**
|
|
143
|
-
|
|
144
|
-
### 群聊发送
|
|
145
|
-
```
|
|
146
|
-
Usage:
|
|
147
|
-
dws chat message send-by-bot [flags]
|
|
148
|
-
Example:
|
|
149
|
-
dws chat message send-by-bot --client-id <clientId> --robot-code <code> --group <openConversationId> \
|
|
150
|
-
--title "日报提醒" --text "请提交今日日报" --format json
|
|
151
|
-
Flags:
|
|
152
|
-
--client-id string 机器人的 clientId / AppKey(多机器人场景必填,确保用正确的机器人身份发送)
|
|
153
|
-
--robot-code string 机器人 code (必填)
|
|
154
|
-
--group string 群会话 ID (必填,与 --users 互斥)
|
|
155
|
-
--title string 消息标题 (必填)
|
|
156
|
-
--text string 消息内容,支持 Markdown (必填)
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### 批量单聊发送
|
|
160
|
-
```
|
|
161
|
-
Usage:
|
|
162
|
-
dws chat message send-by-bot [flags]
|
|
163
|
-
Example:
|
|
164
|
-
dws chat message send-by-bot --client-id <clientId> --robot-code <code> --users "user1,user2" \
|
|
165
|
-
--title "通知" --text "会议已取消" --format json
|
|
166
|
-
Flags:
|
|
167
|
-
--client-id string 机器人的 clientId / AppKey(多机器人场景必填,确保用正确的机器人身份发送)
|
|
168
|
-
--robot-code string 机器人 code (必填)
|
|
169
|
-
--users string 用户 ID 列表,逗号分隔,最多 20 个 (必填,与 --group 互斥)
|
|
170
|
-
--title string 消息标题 (必填)
|
|
171
|
-
--text string 消息内容,支持 Markdown (必填)
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
> ⚠️ `--group` 和 `--users` 互斥:群聊用 `--group`,单聊用 `--users`,不能同时传。
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## message recall-by-bot — 机器人撤回消息
|
|
179
|
-
|
|
180
|
-
支持两种模式:群聊撤回 和 批量单聊撤回。
|
|
181
|
-
|
|
182
|
-
### 群聊撤回
|
|
183
|
-
```
|
|
184
|
-
Usage:
|
|
185
|
-
dws chat message recall-by-bot [flags]
|
|
186
|
-
Example:
|
|
187
|
-
dws chat message recall-by-bot --client-id <clientId> --robot-code <code> --group <openConversationId> \
|
|
188
|
-
--keys "key1,key2" --format json
|
|
189
|
-
Flags:
|
|
190
|
-
--client-id string 机器人的 clientId / AppKey(多机器人场景必填)
|
|
191
|
-
--robot-code string 机器人 code (必填)
|
|
192
|
-
--group string 群会话 ID (必填,与批量单聊互斥)
|
|
193
|
-
--keys string 消息 key 列表,逗号分隔 (必填)
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### 批量单聊撤回
|
|
197
|
-
```
|
|
198
|
-
Usage:
|
|
199
|
-
dws chat message recall-by-bot [flags]
|
|
200
|
-
Example:
|
|
201
|
-
dws chat message recall-by-bot --client-id <clientId> --robot-code <code> --keys "key1,key2" --format json
|
|
202
|
-
Flags:
|
|
203
|
-
--client-id string 机器人的 clientId / AppKey(多机器人场景必填)
|
|
204
|
-
--robot-code string 机器人 code (必填)
|
|
205
|
-
--keys string 消息 key 列表,逗号分隔 (必填)
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
> ⚠️ 消息 key 从 `send-by-bot` 返回结果中提取。
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## message send-by-webhook — 自定义机器人 Webhook 发消息
|
|
213
|
-
|
|
214
|
-
```
|
|
215
|
-
Usage:
|
|
216
|
-
dws chat message send-by-webhook [flags]
|
|
217
|
-
Example:
|
|
218
|
-
dws chat message send-by-webhook --token <robotToken> \
|
|
219
|
-
--title "告警" --text "CPU 使用率超过 90%" --format json
|
|
220
|
-
Flags:
|
|
221
|
-
--token string 自定义机器人 Webhook Token (必填)
|
|
222
|
-
--title string 消息标题 (必填)
|
|
223
|
-
--text string 消息内容 (必填)
|
|
224
|
-
--at-all @所有人
|
|
225
|
-
--at-mobiles string @指定手机号列表,逗号分隔
|
|
226
|
-
--at-users string @指定用户 ID 列表,逗号分隔
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
|
-
## 意图判断
|
|
232
|
-
|
|
233
|
-
- 用户说"搜索一个群" → `search`
|
|
234
|
-
- 用户说"帮我建个群" → `group create`
|
|
235
|
-
- 用户说"看看群里有谁" → `group members list`
|
|
236
|
-
- 用户说"把张三拉进群" → 先 `contact user search` 获取 userId,再 `group members add`
|
|
237
|
-
- 用户说"把张三移出群" → 先 `contact user search` 获取 userId,再 `group members remove`(⚠️ 需确认)
|
|
238
|
-
- 用户说"改一下群名" → `group rename`
|
|
239
|
-
- 用户说"让机器人在群里发通知" → `message send-by-bot --group`
|
|
240
|
-
- 用户说"机器人给张三发消息" → 先 `contact user search` 获取 userId,再 `message send-by-bot --users`
|
|
241
|
-
- 用户说"通过 Webhook 发告警" / 用户有 Webhook Token → `message send-by-webhook`
|
|
242
|
-
- 用户说"撤回机器人消息" → `message recall-by-bot`
|
|
243
|
-
- 用户说"查一下我的机器人" → `bot search`
|
|
244
|
-
- 用户说"把机器人加到群里" → `group members add-bot`
|
|
245
|
-
|
|
246
|
-
**关键区分**: `send-by-bot`(企业内部机器人,需 robotCode) vs `send-by-webhook`(自定义机器人 Webhook,需 token)
|
|
247
|
-
|
|
248
|
-
## 核心工作流
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
# ── 工作流: 建群并添加机器人 ──
|
|
252
|
-
|
|
253
|
-
# 1. 搜索同事 userId
|
|
254
|
-
dws contact user search --keyword "张三" --format json
|
|
255
|
-
|
|
256
|
-
# 2. 创建群
|
|
257
|
-
dws chat group create --name "项目群" --users <userId1>,<userId2> --format json
|
|
258
|
-
|
|
259
|
-
# 3. 搜索机器人
|
|
260
|
-
dws chat bot search --format json
|
|
261
|
-
|
|
262
|
-
# 4. 添加机器人到群
|
|
263
|
-
dws chat group members add-bot --id <openConversationId> --robot-code <code> --format json
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
```bash
|
|
267
|
-
# ── 工作流: 机器人群发消息 ──
|
|
268
|
-
|
|
269
|
-
# 1. 搜索可用机器人
|
|
270
|
-
dws chat bot search --format json
|
|
271
|
-
|
|
272
|
-
# 2. 发送群消息(多机器人场景必须加 --client-id,使用当前对话机器人的 clientId)
|
|
273
|
-
dws chat message send-by-bot --client-id <clientId> --robot-code <code> --group <groupId> \
|
|
274
|
-
--title "通知" --text "内容" --format json
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
# ── 工作流: Webhook 告警 ──
|
|
279
|
-
|
|
280
|
-
# 直接通过 Webhook Token 发送
|
|
281
|
-
dws chat message send-by-webhook --token <token> \
|
|
282
|
-
--title "告警" --text "服务异常" --at-all --format json
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
## 上下文传递表
|
|
286
|
-
|
|
287
|
-
| 操作 | 从返回中提取 | 用于 |
|
|
288
|
-
|------|-------------|------|
|
|
289
|
-
| `search` | openConversationId | `group members` / `group rename` / `group members add` / `send-by-bot --group` |
|
|
290
|
-
| `group create` | openConversationId | 同上 |
|
|
291
|
-
| `bot search` | robotCode | `send-by-bot` / `recall-by-bot` / `add-bot` |
|
|
292
|
-
| `message send-by-bot` | processQueryKey | `recall-by-bot --keys` |
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
# 通讯录 (contact) 命令参考
|
|
2
|
-
|
|
3
|
-
## 命令总览
|
|
4
|
-
|
|
5
|
-
### user (人员查询)
|
|
6
|
-
|
|
7
|
-
#### 获取当前用户信息
|
|
8
|
-
```
|
|
9
|
-
Usage:
|
|
10
|
-
dws contact user get-self [flags]
|
|
11
|
-
Example:
|
|
12
|
-
dws contact user get-self
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
#### 按关键词搜索用户
|
|
16
|
-
```
|
|
17
|
-
Usage:
|
|
18
|
-
dws contact user search [flags]
|
|
19
|
-
Example:
|
|
20
|
-
dws contact user search --keyword "张三"
|
|
21
|
-
Flags:
|
|
22
|
-
--keyword string 搜索关键词 (必填)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
#### 按手机号搜索用户
|
|
26
|
-
```
|
|
27
|
-
Usage:
|
|
28
|
-
dws contact user search-mobile [flags]
|
|
29
|
-
Example:
|
|
30
|
-
dws contact user search-mobile --mobile 13800138000
|
|
31
|
-
Flags:
|
|
32
|
-
--mobile string 手机号 (必填)
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
#### 批量获取用户详情
|
|
36
|
-
```
|
|
37
|
-
Usage:
|
|
38
|
-
dws contact user get [flags]
|
|
39
|
-
Example:
|
|
40
|
-
dws contact user get --ids userId1,userId2
|
|
41
|
-
Flags:
|
|
42
|
-
--ids string 用户 ID 列表,逗号分隔 (必填)
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### dept (部门查询)
|
|
46
|
-
|
|
47
|
-
#### 搜索部门
|
|
48
|
-
```
|
|
49
|
-
Usage:
|
|
50
|
-
dws contact dept search [flags]
|
|
51
|
-
Example:
|
|
52
|
-
dws contact dept search --keyword "技术部"
|
|
53
|
-
Flags:
|
|
54
|
-
--keyword string 搜索关键词 (必填)
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
#### 查看部门成员
|
|
58
|
-
```
|
|
59
|
-
Usage:
|
|
60
|
-
dws contact dept list-members [flags]
|
|
61
|
-
Example:
|
|
62
|
-
dws contact dept list-members --ids 12345,67890
|
|
63
|
-
Flags:
|
|
64
|
-
--ids string 部门 ID 列表,逗号分隔 (必填)
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## 意图判断
|
|
68
|
-
|
|
69
|
-
用户说"我是谁/我的信息" → `user get-self`
|
|
70
|
-
用户说"找人/搜人" → `user search`(按名字)或 `user search-mobile`(按手机号)
|
|
71
|
-
用户说"查用户详情" → `user get`(需 userId)
|
|
72
|
-
用户说"找部门/哪个部门" → `dept search`
|
|
73
|
-
用户说"部门有谁/部门成员" → `dept list-members`(需 deptId)
|
|
74
|
-
|
|
75
|
-
## 核心工作流
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# 1. 查看自己的信息 — 提取 userId
|
|
79
|
-
dws contact user get-self --format json
|
|
80
|
-
|
|
81
|
-
# 2. 按名字搜索同事 — 提取 userId
|
|
82
|
-
dws contact user search --keyword "张三" --format json
|
|
83
|
-
|
|
84
|
-
# 3. 查看部门结构 — 提取 deptId
|
|
85
|
-
dws contact dept search --keyword "技术部" --format json
|
|
86
|
-
|
|
87
|
-
# 4. 查看部门成员
|
|
88
|
-
dws contact dept list-members --ids <deptId> --format json
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## 上下文传递表
|
|
92
|
-
|
|
93
|
-
| 操作 | 提取 | 用于 |
|
|
94
|
-
|------|------|------|
|
|
95
|
-
| `user get-self/search` | `userId` | 其他产品中的 --users/--executor 参数 |
|
|
96
|
-
| `user get-self/search` | `orgAuthEmail` | mail message send 的 --to/--cc (跨产品) |
|
|
97
|
-
| `dept search` | `deptId` | dept list-members 的 --ids |
|
|
98
|
-
|
|
99
|
-
## 注意事项
|
|
100
|
-
|
|
101
|
-
- `user get-self` 是获取 userId 的最快方式,其他产品的 --users/--executor 都需要 userId
|
|
102
|
-
- `user get --ids` 和 `dept list-members --ids` 都支持批量查询,逗号分隔
|
|
103
|
-
|
|
104
|
-
## 自动化脚本
|
|
105
|
-
|
|
106
|
-
| 脚本 | 场景 | 用法 |
|
|
107
|
-
|------|------|------|
|
|
108
|
-
| [contact_dept_members.py](../../scripts/contact_dept_members.py) | 按部门名称搜索并列出所有成员 | `python contact_dept_members.py --keyword "技术部"` |
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# DING 消息 (ding) 命令参考
|
|
2
|
-
|
|
3
|
-
## 命令总览
|
|
4
|
-
|
|
5
|
-
### 发送 DING 消息
|
|
6
|
-
```
|
|
7
|
-
Usage:
|
|
8
|
-
dws ding message send [flags]
|
|
9
|
-
Example:
|
|
10
|
-
dws ding message send --robot-code <ROBOT_CODE> --users <USER_ID_1>,<USER_ID_2> --content "请查看"
|
|
11
|
-
Flags:
|
|
12
|
-
--content string 消息内容 (必填)
|
|
13
|
-
--robot-code string 机器人 ID (必填, 可从 应用管理→机器人 获取, 或设 DINGTALK_DING_ROBOT_CODE)
|
|
14
|
-
--users string 接收人 userId 列表 (必填)
|
|
15
|
-
--type string 提醒类型: app/sms/call (默认 app)
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### 撤回 DING 消息
|
|
19
|
-
```
|
|
20
|
-
Usage:
|
|
21
|
-
dws ding message recall [flags]
|
|
22
|
-
Example:
|
|
23
|
-
dws ding message recall --robot-code <ROBOT_CODE> --id <OPEN_DING_ID>
|
|
24
|
-
Flags:
|
|
25
|
-
--id string DING 消息 ID (必填)
|
|
26
|
-
--robot-code string 机器人 ID (必填, 或设 DINGTALK_DING_ROBOT_CODE)
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 意图判断
|
|
30
|
-
|
|
31
|
-
用户说"DING 一下/紧急通知/电话提醒" → `message send`
|
|
32
|
-
用户说"撤回 DING" → `message recall`
|
|
33
|
-
|
|
34
|
-
关键区分:
|
|
35
|
-
- ding(紧急提醒, 支持电话/短信) vs bot(常规群/单聊消息)
|
|
36
|
-
- sms/call 类型有通信费用
|
|
37
|
-
|
|
38
|
-
## 核心工作流
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# 应用内 DING (免费)
|
|
42
|
-
dws ding message send --robot-code <ROBOT_CODE> --type app --users userId1,userId2 --content "请查看" --format json
|
|
43
|
-
|
|
44
|
-
# 电话 DING (紧急, 有成本!)
|
|
45
|
-
dws ding message send --robot-code <ROBOT_CODE> --type call --users userId1 --content "紧急告警" --format json
|
|
46
|
-
|
|
47
|
-
# 撤回
|
|
48
|
-
dws ding message recall --robot-code <ROBOT_CODE> --id <OPEN_DING_ID> --format json
|
|
49
|
-
```
|
|
50
|
-
## 上下文传递表
|
|
51
|
-
| 操作 | 提取 | 用于 |
|
|
52
|
-
|------|------|------|
|
|
53
|
-
| `message send` | `openDingId` | message recall 的 --id |
|
|
54
|
-
## 注意事项
|
|
55
|
-
- `--robot-code` 从钉钉开放平台 **应用管理 → 机器人** 中获取,也可设环境变量 `DINGTALK_DING_ROBOT_CODE`
|
|
56
|
-
- sms/call 类型有通信费用,使用前需和用户确认
|
|
57
|
-
- 默认 `--type app`(应用内 DING,免费)
|