@lansenger-pm/openclaw-lansenger-channel 3.0.1 → 3.0.2
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/package.json +1 -1
- package/skills/lansenger-messaging/SKILL.md +121 -158
package/package.json
CHANGED
|
@@ -1,227 +1,190 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lansenger-messaging
|
|
3
|
-
description: How to communicate on Lansenger (蓝信) — choose the right tool, when, send rich content, and pitfalls
|
|
3
|
+
description: How to communicate on Lansenger (蓝信) — choose the right tool, when, and send rich content, and approvals, and pitfalls
|
|
4
4
|
metadata: {"openclaw":{"requires":{"config":["channels.lansenger"]},"primaryEnv":"LANSENGER_APP_ID"}}
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
```
|
|
8
|
+
|
|
7
9
|
# Lansenger (蓝信) Messaging — Agent Quick Reference
|
|
8
10
|
|
|
9
|
-
You
|
|
11
|
+
You`
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
在 a Lansenger session, **just write your reply normally** — Markdown renders automatically as formatText. No tool needed for formatted text unless you also need @mentions.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
However, Markdown and file attachments are **mutually exclusive**. If you need both formatting AND a file, send the Markdown reply first, then call `lansenger_send_file` separately.
|
|
16
|
+
Never put raw Markdown in lansenger_send_text — itansenger_send_format_text — it displays shows as ugly source code.
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
Need to send something? Follow this decision tree:
|
|
18
|
+
> ⚠️ This is reference documentation, NOT a CLI command. `openclaw skill lansenger-messaging` does not exist. Use the agent tools directly.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
2. Need Markdown + @mention someone → lansenger_send_format_text (with reminder)
|
|
21
|
-
3. Need plain text + @mention + file → lansenger_send_text (with reminder + filePath)
|
|
22
|
-
4. Need just a FILE (any local file) → lansenger_send_file
|
|
23
|
-
5. Need image from URL → lansenger_send_image_url
|
|
24
|
-
6. Need a link card → lansenger_send_link_card
|
|
25
|
-
7. Need multi-article card (图文) → lansenger_send_app_articles
|
|
26
|
-
8. Need a rich formatted card → lansenger_send_app_card
|
|
27
|
-
9. Need approval workflow → lansenger_send_app_card (isDynamic=true) → update via lansenger_update_dynamic_card
|
|
28
|
-
10. Need to revoke a message → lansenger_revoke_message
|
|
29
|
-
11. Need group IDs → lansenger_query_groups
|
|
30
|
-
```
|
|
31
|
-
> ⚠️ Group chat: appCard/linkCard/appArticles/formatText may be rejected by API. Fall back to lansenger_send_text.
|
|
32
|
-
```
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## #1 Rule: Markdown Is Automatic
|
|
36
|
-
In a Lansenger session, **just write your reply normally** — Markdown is automatically rendered as formatText. You never need to call a tool for formatted text unless you also need @mentions.
|
|
37
|
-
|
|
38
|
-
However: Markdown and file attachments are **mutually exclusive**. If you need both formatting AND a file, send the Markdown reply first, then call `lansenger_send_file separately.
|
|
39
|
-
Never put raw Markdown in lansenger_send_text — it displays as ugly source code.
|
|
20
|
+
## Quick Decision: What Tool Do I Use?
|
|
40
21
|
|
|
41
|
-
|
|
22
|
+
Need to send something? Follow this decision tree:
|
|
23
|
+
1. Normal reply with formatting → JUST WRITE IT. No tool needed.
|
|
24
|
+
2. Markdown + @mention → lansenger_send_format_text (with reminder)
|
|
25
|
+
3. Plain text + @mention + file → lansenger_send_text (with reminder + filePath)
|
|
26
|
+
4. Send a FILE → lansenger_send_file
|
|
27
|
+
5. Send image from URL → lansenger_send_image_url
|
|
28
|
+
6. Link card → lansenger_send_link_card
|
|
29
|
+
7. Multi-article card (图文) → lansenger_send_app_articles
|
|
30
|
+
8. Rich formatted card → lansenger_send_app_card
|
|
31
|
+
9. Approval workflow → lansenger_send_app_card (isDynamic=true), → update via lansenger_update_dynamic_card
|
|
32
|
+
10. Revoke a message → lansenger_revoke_message
|
|
33
|
+
11. Find group IDs → lansenger_query_groups
|
|
34
|
+
|
|
35
|
+
> ⚠️ **Group chat**: appCard/linkCard/appArticles/formatText may be rejected by API. Fall back to lansenger_send_text.
|
|
42
36
|
|
|
43
37
|
## Message Type Capability Matrix
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
│ formatText │ ✓ (auto) │ ✓ (reminder)│ ✗ │
|
|
49
|
-
│ text │ ✗ │ ✓ │ ✓ │
|
|
50
|
-
└──────────────┴──────────────┴──────────────┴──────────────┘
|
|
51
|
-
```
|
|
52
|
-
- formatText: default outbound type. Markdown renders automatically. Also supports @mentions via `reminder` param (auto-fallback if API rejects). No file attachments.
|
|
53
|
-
- text: plain text only. Supports @mentions + file attachments. No Markdown rendering.
|
|
38
|
+
| Type | Markdown | @mention | Attachments |
|
|
39
|
+
|----------|----------|----------|------------|
|
|
40
|
+
| formatText | ✓ (auto) | ✓ (reminder) | ✗ |
|
|
41
|
+
| text | ✗ | ✓ | ✓ |
|
|
54
42
|
|
|
43
|
+
- formatText: Markdown renders, supports @mention via reminder param (auto-fallback if API rejects). No file attachments.
|
|
44
|
+
- text: Plain text only. Supports @mention + file attachment. No Markdown rendering.
|
|
55
45
|
- These two types are **mutually exclusive** — pick one based on what you need.
|
|
56
|
-
```
|
|
57
|
-
---
|
|
58
46
|
|
|
59
47
|
## Tool Reference
|
|
60
|
-
All tools accept optional `to` (chatId). Leave empty to auto-detect current conversation. Only fill for different chat. chatId is case-sensitive.
|
|
61
|
-
```
|
|
62
|
-
How to get chatId: Inbound message senderId/conversationId. Never truncate or modify a chatId.
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
---
|
|
66
|
-
|
|
48
|
+
All tools accept optional `to` (chatId). Leave empty to auto-detect current conversation. Only fill for different chat. chatId is case-sensitive — never truncate or modify.
|
|
67
49
|
### lansenger_send_file
|
|
68
|
-
| Param | Required | Description |
|
|
69
|
-
|
|
70
|
-
| filePath | ✅
|
|
71
|
-
| caption | ❌
|
|
72
|
-
| to
|
|
73
|
-
|
|
50
|
+
| Param | Type | Required | Description |
|
|
51
|
+
|---------|----------|----------|-------------|
|
|
52
|
+
| filePath | string ✅ | Absolute local path (workspace, /tmp, Desktop, etc.) |
|
|
53
|
+
| caption | string ❌ | Plain-text caption (no Markdown) |
|
|
54
|
+
| to | string ❌ | Target chatId (auto if omitted) |
|
|
55
|
+
|
|
56
|
+
> ⚠️ **MEDIA: tags currently broken** — they silently fail for ALL files, not just workspace ones Use lansenger_send_file for every file attachment.
|
|
74
57
|
|
|
75
58
|
### lansenger_send_text
|
|
76
|
-
| Param | Required | Description |
|
|
77
|
-
|
|
78
|
-
| content | ✅
|
|
79
|
-
| filePath | ❌
|
|
80
|
-
| to
|
|
81
|
-
| reminderAll | ❌
|
|
82
|
-
| reminderUserIds |
|
|
59
|
+
| Param | Type | Required | Description |
|
|
60
|
+
|---------|----------|----------|-------------|
|
|
61
|
+
| content | string ✅ | Plain text only (NO Markdown) |
|
|
62
|
+
| filePath | string ❌ | Optional file to attach (content becomes caption) |
|
|
63
|
+
| to | string ❌ | Target chatId |
|
|
64
|
+
| reminderAll | boolean ❌ | @mention all members (group only) |
|
|
65
|
+
| reminderUserIds | string[] | ❌ | @mention specific users (group only) |
|
|
83
66
|
|
|
84
67
|
### lansenger_send_format_text
|
|
85
|
-
| Param | Required | Description |
|
|
86
|
-
|
|
87
|
-
| content | ✅
|
|
88
|
-
| to
|
|
89
|
-
| reminderAll | ❌
|
|
90
|
-
| reminderUserIds |
|
|
68
|
+
| Param | Type | Required | Description |
|
|
69
|
+
|---------|----------|----------|-------------|
|
|
70
|
+
| content | string ✅ | Markdown text |
|
|
71
|
+
| to | string ❌ | Target chatId |
|
|
72
|
+
| reminderAll | boolean ❌ | @mention all (group only) |
|
|
73
|
+
| reminderUserIds | string[] | ❌ | @mention specific users (group only) |
|
|
91
74
|
|
|
92
75
|
> Use when you need Markdown + @mention. No file attachments. Plugin auto-fallback if API rejects reminder.
|
|
93
76
|
|
|
94
|
-
Always include "@姓名" in text when mentioning someone.
|
|
95
|
-
|
|
77
|
+
> Always include "@姓名" in text when mentioning someone.
|
|
96
78
|
### lansenger_send_image_url
|
|
97
|
-
| Param | Required | Description |
|
|
98
|
-
|
|
99
|
-
| imageUrl | ✅
|
|
100
|
-
| caption | ❌
|
|
101
|
-
| to
|
|
102
|
-
|
|
103
|
-
> URL must be reachable from gateway host. For local files use lansenger_send_file.
|
|
79
|
+
| Param | Type | Required | Description |
|
|
80
|
+
|---------|----------|----------|-------------|
|
|
81
|
+
| imageUrl | string ✅ | Directly reachable image URL |
|
|
82
|
+
| caption | string ❌ | Plain-text caption (no Markdown) |
|
|
83
|
+
| to | string ❌ | Target chatId |
|
|
104
84
|
|
|
85
|
+
> URL must be reachable from the gateway host. For local files, use lansenger_send_file.
|
|
105
86
|
### lansenger_send_link_card
|
|
106
|
-
| Param | Required | Description |
|
|
107
|
-
|
|
108
|
-
| title
|
|
109
|
-
| link
|
|
110
|
-
| description | ❌
|
|
111
|
-
| iconLink
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
87
|
+
| Param | Type | Required | Description |
|
|
88
|
+
|---------|----------|----------|-------------|
|
|
89
|
+
| title | string ✅ | Card title |
|
|
90
|
+
| link | string ✅ | Click-through URL |
|
|
91
|
+
| description | string ❌ | Card description (API-required, defaults empty) |
|
|
92
|
+
| iconLink | string ❌ | Icon URL (defaults empty) |
|
|
93
|
+
| pcLink | string ❌ | PC client link |
|
|
94
|
+
| fromName | string ❌ | Source name (defaults empty) |
|
|
95
|
+
| fromIconLink | string ❌ | Source icon URL (defaults empty) |
|
|
96
|
+
| to | string ❌ | Target chatId |
|
|
116
97
|
### lansenger_send_app_articles
|
|
117
|
-
| Param | Required | Description |
|
|
118
|
-
|
|
119
|
-
| articles |
|
|
120
|
-
| to
|
|
98
|
+
| Param | Type | Required | Description |
|
|
99
|
+
|---------|----------|----------|-------------|
|
|
100
|
+
| articles | object[] | ✅ | Each: { imgUrl, title, url, summary?, pcUrl? } |
|
|
101
|
+
| to | string ❌ | Target chatId |
|
|
121
102
|
|
|
122
103
|
> ⚠️ Article summary field is `summary`, NOT `description`. `description` is silently ignored.
|
|
123
|
-
|
|
124
104
|
### lansenger_send_app_card
|
|
125
|
-
| Param | Required | Description |
|
|
126
|
-
|
|
127
|
-
| bodyTitle | ✅
|
|
128
|
-
| headTitle | ❌
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
105
|
+
| Param | Type | Required | Description |
|
|
106
|
+
|---------|----------|----------|-------------|
|
|
107
|
+
| bodyTitle | string ✅ | Card title (supports div-style) |
|
|
108
|
+
| headTitle | string ❌ | Header title |
|
|
109
|
+
| bodySubTitle | string ❌ | Subtitle (supports div-style) |
|
|
110
|
+
| bodyContent | string ❌ | Main content (supports div-style) |
|
|
111
|
+
| signature | string ❌ | Footer signature |
|
|
112
|
+
| isDynamic | boolean ❌ | Enable approval workflow (default: false) |
|
|
113
|
+
| headStatusInfo | object ❌ | { description, colour } — description: status TEXT (supports div-style for color, e.g. `<div style="color:#FFB116">待审批</div>`, max 30 bytes), colour: DOT/圆点 color (hex e.g. #FFB116). They are TWO different things: text color vs dot color. |
|
|
114
|
+
| fields | object[] | ❌ | Key-value pairs (max 10) |
|
|
115
|
+
| links | object[] | ❌ | Links (max 3): { title, url } |
|
|
116
|
+
| cardLink | string ❌ | Card click-through link |
|
|
117
|
+
| staffId | string ❌ | Staff openId for sender avatar |
|
|
118
|
+
| headIconUrl | string ❌ | Header icon URL |
|
|
119
|
+
| to | string ❌ | Target chatId |
|
|
135
120
|
|
|
136
121
|
> ⚠️ **Group chat does NOT support appCard** — falls back to plain text. Approval workflows won't work in group chat.
|
|
137
122
|
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
div-style formatting rules:
|
|
123
|
+
**div-style rules:**
|
|
142
124
|
- `color`: hex (e.g. #333, #007BFF)
|
|
143
125
|
- `font-size`: **MUST use pt** (12pt–36pt). px causes "invalid bodyContent" error.
|
|
144
126
|
- `text-align`: left, center, right
|
|
145
127
|
- `text-indent`: **MUST use 0em** — bare 0 causes silent failure
|
|
146
|
-
```
|
|
147
128
|
|
|
148
129
|
Example: `<div style="color:#333;font-size:14pt;text-indent:0em;text-align:left">Content here</div>`
|
|
149
|
-
```
|
|
150
|
-
---
|
|
151
|
-
|
|
152
130
|
### lansenger_update_dynamic_card
|
|
153
|
-
| Param | Required | Description |
|
|
154
|
-
|
|
155
|
-
| msgId
|
|
156
|
-
| headStatusInfo | ❌
|
|
157
|
-
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
131
|
+
| Param | Type | Required | Description |
|
|
132
|
+
|---------|----------|----------|-------------|
|
|
133
|
+
| msgId | string ✅ | Message ID from original send_app_card response |
|
|
134
|
+
| headStatusInfo | object ❌ | { description, colour } — description: status TEXT (supports div-style for color), colour: DOT/圆点 color (hex). Independent. |
|
|
135
|
+
| links | object[] | ❌ | Updated links (max 3) |
|
|
136
|
+
| isLastUpdate | boolean ❌ | True = final state, card becomes static (default: false) |
|
|
137
|
+
|
|
138
|
+
> Set isLastUpdate=true on final approval decision. Intermediate updates steps: keep isLastUpdate=false.
|
|
161
139
|
### lansenger_revoke_message
|
|
162
|
-
| Param | Required | Description |
|
|
163
|
-
|
|
164
|
-
| messageIds |
|
|
165
|
-
| chatType | ❌
|
|
166
|
-
| senderId | ❌
|
|
167
|
-
|
|
140
|
+
| Param | Type | Required | Description |
|
|
141
|
+
|---------|----------|----------|-------------|
|
|
142
|
+
| messageIds | string[] | ✅ | List of message IDs |
|
|
143
|
+
| chatType | string ❌ | bot (default) or group |
|
|
144
|
+
| senderId | string ❌ | Required if chatType=group |
|
|
168
145
|
### lansenger_query_groups
|
|
169
|
-
| Param | Required | Description |
|
|
170
|
-
|
|
171
|
-
| pageOffset | ❌
|
|
172
|
-
| pageSize
|
|
146
|
+
| Param | Type | Required | Description |
|
|
147
|
+
|---------|----------|----------|-------------|
|
|
148
|
+
| pageOffset | integer ❌ | Page number (default: 1) |
|
|
149
|
+
| pageSize | integer ❌ | Groups per page (default: 100) |
|
|
173
150
|
|
|
174
151
|
> ⚠️ May return errCode=10005 "API服务无权限" on enterprise deployments. Ask user for group IDs manually.
|
|
175
152
|
|
|
176
|
-
---
|
|
177
|
-
|
|
178
153
|
## Approval Workflow Pattern
|
|
179
|
-
|
|
180
|
-
1. Send: lansenger_send_app_card(bodyTitle="...", isDynamic=true, headStatusInfo={description: '<div style="color:#FFB116">待审批</div>', colour: "#FFB116"})
|
|
154
|
+
1. Send: `lansenger_send_app_card(bodyTitle="...", isDynamic=true, headStatusInfo={description: '<div style="color:#FFB116">待审批</div>', colour: "#FFB116"})`
|
|
181
155
|
2. User approves/denies → OpenClaw processes approval
|
|
182
|
-
3. Update: lansenger_update_dynamic_card(msgId="<from step 1>", headStatusInfo={description: '<div style="color:#198754">已批准</div>', colour: "#198754"}, isLastUpdate=true)
|
|
183
|
-
```
|
|
184
|
-
Status colors: #FFB116 (pending), #198754 (approved) #dc3545 (denied)
|
|
156
|
+
3. Update: `lansenger_update_dynamic_card(msgId="<from step 1>", headStatusInfo={description: '<div style="color:#198754">已批准</div>', colour: "#198754"}, isLastUpdate=true)`
|
|
185
157
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
---
|
|
158
|
+
Status colors: #FFB116 (pending), #198754 (approved), #dc3545 (denied)
|
|
159
|
+
> ⚠️ **Approval only works in DM (1:1 chat)** — group chat appCard falls back to plain text.
|
|
160
|
+
> Set `isLastUpdate=true` on final decision. Keep `isLastUpdate=false` for intermediate updates step.
|
|
190
161
|
|
|
191
162
|
## @Mention Rules
|
|
192
|
-
Both formatText and text support @mentions
|
|
193
|
-
- formatText: `reminderAll` + `reminderUserIds` params
|
|
194
|
-
- text: `reminderAll` + `reminderUserIds` params
|
|
195
|
-
|
|
163
|
+
Both formatText and text support @mentions via `reminderAll` + `reminderUserIds` params.
|
|
196
164
|
Two rules:
|
|
197
|
-
1. Always include "@姓名" in message text — reminder sends the push, "@姓名" makes it visible
|
|
198
|
-
2. reminder is optional —
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
165
|
+
1. Always include "@姓名" in message text — reminder sends the push notification, "@姓名" makes it visible in message
|
|
166
|
+
2. reminder is optional — recommended in group chat when replying to someone
|
|
202
167
|
## Inbound Messages
|
|
203
|
-
| Type
|
|
168
|
+
| Type | What you see |
|
|
204
169
|
|------|-------------|
|
|
205
170
|
| text | Plain text |
|
|
206
171
|
| formatText | Markdown text |
|
|
207
172
|
| image | [Image] + local file paths |
|
|
208
|
-
| video | [Video] + local file
|
|
209
|
-
| file | [File] + local file
|
|
173
|
+
| video | [Video] + local file path |
|
|
174
|
+
| file | [File] + local file path |
|
|
210
175
|
| voice | [Voice] + local file path |
|
|
211
176
|
| position | [Location] name address lat,long |
|
|
212
177
|
| card | [Contact Card] staffId |
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
178
|
+
| sticker | [Sticker] stickerId |
|
|
216
179
|
## Common Pitfalls
|
|
217
180
|
| Pitfall | Fix |
|
|
218
181
|
|---------|-----|
|
|
219
182
|
| Raw Markdown in text tool | Never do this — shows as ugly source code. Write normally for Markdown. |
|
|
220
|
-
| MEDIA: tag for
|
|
183
|
+
| MEDIA: tag for file delivery | ⚠️ Currently broken for ALL files. Use lansenger_send_file for every file attachment. |
|
|
221
184
|
| AppArticles `description` field | Use `summary`, not `description`. `description` is ignored. |
|
|
222
|
-
| AppCard `font-size:
|
|
223
|
-
| AppCard `text-indent: 0` | Use `
|
|
224
|
-
|
|
|
185
|
+
| AppCard `font-size: px` | Use `pt` units (12pt–36pt). px causes API error. |
|
|
186
|
+
| AppCard `text-indent: 0` | Use `0em` with unit. Bare 0 causes silent failure. |
|
|
187
|
+
| headStatusInfo div wrapping | description supports div-style for color. colour is the DOT/圆点 color only. They are separate. |
|
|
225
188
|
| Group chat appCard | Falls back to plain text. Approval workflows won't work. Use text + /approve. |
|
|
226
|
-
| Message too long | ~4000 character limit. Split
|
|
189
|
+
| Message too long | ~4000 character limit. Split into multiple messages. |
|
|
227
190
|
| `openclaw skill` command | Does NOT exist. Use agent tools directly. |
|