@lansenger-pm/openclaw-lansenger-channel 3.2.2 → 3.2.4
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/README.fr.md +25 -22
- package/README.md +27 -10
- package/README.zhHans.md +27 -10
- package/README.zhHant.md +25 -22
- package/README.zhHantHK.md +25 -22
- package/dist/index.d.ts +11 -0
- package/dist/setup-entry.d.ts +8 -0
- package/dist/src/channel.d.ts +23 -0
- package/dist/src/channel.test.d.ts +1 -0
- package/dist/src/client.d.ts +208 -0
- package/dist/src/client.test.d.ts +1 -0
- package/dist/src/runtime.d.ts +8 -0
- package/dist/src/setup-wizard.d.ts +1 -0
- package/dist/src/setup-wizard.js +19 -0
- package/dist/src/setup-wizard.js.map +1 -1
- package/dist/src/setup-wizard.test.d.ts +1 -0
- package/openclaw.plugin.json +5 -44
- package/package.json +11 -5
- package/skills/lansenger-messaging/SKILL.md +172 -147
- package/dist/src/tools.js +0 -410
- package/dist/src/tools.js.map +0 -1
- package/dist/tools-entry.js +0 -13
- package/dist/tools-entry.js.map +0 -1
- package/index.ts +0 -18
- package/setup-entry.ts +0 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/channel-core";
|
|
2
|
+
import { LansengerClient } from "./client.js";
|
|
3
|
+
import type { ResolvedAccount } from "./channel.js";
|
|
4
|
+
export declare function getLastInboundChatId(): string;
|
|
5
|
+
export declare function getLastInboundTime(): number | null;
|
|
6
|
+
export declare function getRunningClient(): LansengerClient | null;
|
|
7
|
+
export declare function getRunningAccount(): ResolvedAccount | null;
|
|
8
|
+
export declare function startLansengerGateway(api: OpenClawPluginApi): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const lansengerSetupWizard: any;
|
package/dist/src/setup-wizard.js
CHANGED
|
@@ -31,6 +31,10 @@ const HELP_LINES = [
|
|
|
31
31
|
"Personal Bots only — organization bots not supported / 仅支持个人机器人",
|
|
32
32
|
"Mobile client does NOT support viewing credentials / 移动端不支持查看凭证",
|
|
33
33
|
`Docs: ${formatDocsLink("https://open.e.lanxin.cn/docs", "lansenger")}`,
|
|
34
|
+
"",
|
|
35
|
+
"⚠️ Agent tools require a separate plugin, CLI requires a Python package: / 代理工具或 CLI 需单独安装:",
|
|
36
|
+
" Option A: openclaw plugins install @lansenger-pm/openclaw-lansenger-tools",
|
|
37
|
+
" Option B: pip install lansenger-cli",
|
|
34
38
|
];
|
|
35
39
|
function makeInspect(field, envVar) {
|
|
36
40
|
return ({ cfg, accountId }) => {
|
|
@@ -226,5 +230,20 @@ export const lansengerSetupWizard = {
|
|
|
226
230
|
},
|
|
227
231
|
}),
|
|
228
232
|
disable: (cfg) => setSetupChannelEnabled(cfg, CHANNEL, false),
|
|
233
|
+
companionNote: {
|
|
234
|
+
title: "Install Messaging Tools / 安装消息工具",
|
|
235
|
+
lines: [
|
|
236
|
+
"To send files, cards, and formatted messages, install one of: / 发送文件、卡片和格式化消息,安装以下任一:",
|
|
237
|
+
"",
|
|
238
|
+
" Option A: OpenClaw agent tools plugin / 方案 A:OpenClaw 代理工具插件",
|
|
239
|
+
" openclaw plugins install @lansenger-pm/openclaw-lansenger-tools",
|
|
240
|
+
"",
|
|
241
|
+
" Option B: Python CLI (works via bash) / 方案 B:Python CLI(通过 bash 调用)",
|
|
242
|
+
" pip install lansenger-cli",
|
|
243
|
+
"",
|
|
244
|
+
"Without either, the agent can only reply via normal Markdown text. / 未安装任一时,代理只能通过普通 Markdown 文本回复。",
|
|
245
|
+
],
|
|
246
|
+
shouldShow: () => true,
|
|
247
|
+
},
|
|
229
248
|
};
|
|
230
249
|
//# sourceMappingURL=setup-wizard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-wizard.js","sourceRoot":"","sources":["../../src/setup-wizard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAC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CAAC,GAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC;IAElE,aAAa,EAAE;QACb,KAAK,EAAE,kCAAkC;QACzC,KAAK,EAAE;YACL,uFAAuF;YACvF,EAAE;YACF,gEAAgE;YAChE,qEAAqE;YACrE,EAAE;YACF,uEAAuE;YACvE,+BAA+B;YAC/B,EAAE;YACF,qGAAqG;SACtG;QACD,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI;KACvB;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/openclaw.plugin.json
CHANGED
|
@@ -16,50 +16,11 @@
|
|
|
16
16
|
"onChannels": ["lansenger"],
|
|
17
17
|
"onConfigPaths": ["channels.lansenger"]
|
|
18
18
|
},
|
|
19
|
-
"
|
|
20
|
-
"tools":
|
|
21
|
-
"
|
|
22
|
-
"lansenger_send_text",
|
|
23
|
-
"
|
|
24
|
-
"lansenger_send_image_url",
|
|
25
|
-
"lansenger_revoke_message",
|
|
26
|
-
"lansenger_send_link_card",
|
|
27
|
-
"lansenger_send_app_articles",
|
|
28
|
-
"lansenger_send_app_card",
|
|
29
|
-
"lansenger_update_dynamic_card",
|
|
30
|
-
"lansenger_query_groups"
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
"toolMetadata": {
|
|
34
|
-
"lansenger_send_file": {
|
|
35
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
36
|
-
},
|
|
37
|
-
"lansenger_send_text": {
|
|
38
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
39
|
-
},
|
|
40
|
-
"lansenger_send_format_text": {
|
|
41
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
42
|
-
},
|
|
43
|
-
"lansenger_send_image_url": {
|
|
44
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
45
|
-
},
|
|
46
|
-
"lansenger_revoke_message": {
|
|
47
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
48
|
-
},
|
|
49
|
-
"lansenger_send_link_card": {
|
|
50
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
51
|
-
},
|
|
52
|
-
"lansenger_send_app_articles": {
|
|
53
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
54
|
-
},
|
|
55
|
-
"lansenger_send_app_card": {
|
|
56
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
57
|
-
},
|
|
58
|
-
"lansenger_update_dynamic_card": {
|
|
59
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
60
|
-
},
|
|
61
|
-
"lansenger_query_groups": {
|
|
62
|
-
"configSignals": [{ "rootPath": "channels.lansenger", "required": ["appId", "appSecret"] }]
|
|
19
|
+
"companionPlugins": {
|
|
20
|
+
"lansenger-tools": {
|
|
21
|
+
"npmSpec": "@lansenger-pm/openclaw-lansenger-tools",
|
|
22
|
+
"description": "Lansenger messaging tools (lansenger_send_file, lansenger_send_text, etc.) — required for agent tool access / 蓝信消息工具插件,Agent 需要 Tools 功能时必须安装",
|
|
23
|
+
"required": true
|
|
63
24
|
}
|
|
64
25
|
},
|
|
65
26
|
"skills": ["./skills"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lansenger-pm/openclaw-lansenger-channel",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
"dist/",
|
|
11
11
|
"skills/",
|
|
12
12
|
"openclaw.plugin.json",
|
|
13
|
-
"index.ts",
|
|
14
|
-
"setup-entry.ts",
|
|
15
13
|
"README.md",
|
|
16
14
|
"README.zhHans.md",
|
|
17
15
|
"README.zhHant.md",
|
|
@@ -42,12 +40,12 @@
|
|
|
42
40
|
],
|
|
43
41
|
"openclaw": {
|
|
44
42
|
"extensions": [
|
|
45
|
-
"./
|
|
43
|
+
"./dist/index.js"
|
|
46
44
|
],
|
|
47
45
|
"runtimeExtensions": [
|
|
48
46
|
"./dist/index.js"
|
|
49
47
|
],
|
|
50
|
-
"setupEntry": "./
|
|
48
|
+
"setupEntry": "./dist/setup-entry.js",
|
|
51
49
|
"runtimeSetupEntry": "./dist/setup-entry.js",
|
|
52
50
|
"channel": {
|
|
53
51
|
"id": "lansenger",
|
|
@@ -99,6 +97,14 @@
|
|
|
99
97
|
"typescript": "^6.0.3",
|
|
100
98
|
"vitest": "^4.1.6"
|
|
101
99
|
},
|
|
100
|
+
"peerDependencies": {
|
|
101
|
+
"@lansenger-pm/openclaw-lansenger-tools": ">=1.0.0"
|
|
102
|
+
},
|
|
103
|
+
"peerDependenciesMeta": {
|
|
104
|
+
"@lansenger-pm/openclaw-lansenger-tools": {
|
|
105
|
+
"optional": false
|
|
106
|
+
}
|
|
107
|
+
},
|
|
102
108
|
"dependencies": {
|
|
103
109
|
"ws": "^8.20.0"
|
|
104
110
|
}
|
|
@@ -1,26 +1,39 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lansenger-messaging
|
|
3
|
-
description: Lansenger (蓝信)
|
|
4
|
-
metadata: {"openclaw":{"requires":{"config":["channels.lansenger"]},"primaryEnv":"LANSENGER_APP_ID"}}
|
|
3
|
+
description: How to communicate on Lansenger (蓝信) — choose the right tool or CLI command, send rich content, approvals, and pitfalls
|
|
4
|
+
metadata: {"openclaw":{"requires":{"config":["channels.lansenger"],"plugins":["lansenger-tools"]},"primaryEnv":"LANSENGER_APP_ID"}}
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Lansenger (蓝信) Messaging —
|
|
7
|
+
# Lansenger (蓝信) Messaging — Agent Quick Reference
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
> ⚠️ **Agent tools require the `lansenger-tools` plugin** — install with `openclaw plugins install @lansenger-pm/openclaw-lansenger-tools`. Without it, only normal Markdown replies and CLI commands work.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
In 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
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
You can send messages via **agent tools** or **CLI commands**. Both work. Choose whichever is available:
|
|
14
|
+
|
|
15
|
+
- **Agent tools**: `lansenger_send_file`, `lansenger_send_text`, etc. — available when `lansenger-tools` plugin is installed.
|
|
16
|
+
- **CLI commands**: `lansenger message send-file`, `lansenger message send-text`, etc. — available via bash.
|
|
17
|
+
|
|
18
|
+
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` or `lansenger message send-file` separately.
|
|
19
|
+
|
|
20
|
+
**Never put raw Markdown in lansenger_send_text / send-text** — it displays as ugly source code.
|
|
21
|
+
|
|
22
|
+
## Quick Decision: What Tool/Command Do I Use?
|
|
23
|
+
|
|
24
|
+
Need to send something? Follow this decision tree:
|
|
25
|
+
|
|
26
|
+
1. Normal reply with formatting → JUST WRITE IT. No tool needed.
|
|
27
|
+
2. Markdown + @mention → `lansenger_send_format_text` or `lansenger message send-markdown`
|
|
28
|
+
3. Plain text + @mention + file → `lansenger_send_text` or `lansenger message send-text`
|
|
29
|
+
4. Send a FILE → `lansenger_send_file` or `lansenger message send-file`
|
|
30
|
+
5. Send image from URL → `lansenger_send_image_url` or `lansenger message send-image-url`
|
|
31
|
+
6. Link card → `lansenger_send_link_card` or `lansenger message send-link-card`
|
|
32
|
+
7. Multi-article card (图文) → `lansenger_send_app_articles` or `lansenger message send-app-articles`
|
|
33
|
+
8. Rich formatted card → `lansenger_send_app_card` or `lansenger message send-app-card`
|
|
34
|
+
9. Approval workflow → sendAppCard(isDynamic=true) → updateDynamicCard
|
|
35
|
+
10. Revoke a message → `lansenger_revoke_message` or `lansenger message revoke`
|
|
36
|
+
11. Find group IDs → `lansenger_query_groups` or `lansenger message query-groups`
|
|
24
37
|
|
|
25
38
|
## Message Type Capability Matrix
|
|
26
39
|
|
|
@@ -29,188 +42,199 @@ Use `lansenger` CLI commands via bash to send messages. The OpenClaw plugin tool
|
|
|
29
42
|
| formatText | ✓ (auto) | ✓ (reminder) | ✗ |
|
|
30
43
|
| text | ✗ | ✓ | ✓ |
|
|
31
44
|
|
|
32
|
-
- formatText
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
- **formatText**: Markdown renders, supports @mention via reminder param (auto-fallback if API rejects). No file attachments.
|
|
46
|
+
- **text**: Plain text only. Supports @mention + file attachment. No Markdown rendering.
|
|
47
|
+
- These two types are **mutually exclusive** — pick one based on what you need.
|
|
48
|
+
|
|
49
|
+
## Agent Tool Reference
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
### lansenger_send_file
|
|
54
|
+
|
|
55
|
+
| Param | Type | Required | Description |
|
|
56
|
+
|----------------|----------|----------|----------------------------------------------------|
|
|
57
|
+
| filePath | string | ✅ | Absolute local path (workspace, /tmp, Desktop, etc.) |
|
|
58
|
+
| caption | string | ❌ | Plain-text caption (no Markdown) |
|
|
59
|
+
| to | string | ❌ | Target chatId (auto if omitted) |
|
|
60
|
+
|
|
61
|
+
### lansenger_send_text
|
|
62
|
+
|
|
63
|
+
| Param | Type | Required | Description |
|
|
64
|
+
|----------------|----------|----------|----------------------------------------------------|
|
|
65
|
+
| content | string | ✅ | Plain text only (NO Markdown) |
|
|
66
|
+
| filePath | string | ❌ | Optional file to attach (content becomes caption) |
|
|
67
|
+
| to | string | ❌ | Target chatId |
|
|
68
|
+
| reminderAll | boolean | ❌ | @mention all members (group only) |
|
|
69
|
+
| reminderUserIds | string[] | ❌ | @mention specific users (group only) |
|
|
70
|
+
|
|
71
|
+
### lansenger_send_format_text
|
|
72
|
+
|
|
73
|
+
| Param | Type | Required | Description |
|
|
74
|
+
|----------------|----------|----------|----------------------------------------------------|
|
|
75
|
+
| content | string | ✅ | Markdown text |
|
|
76
|
+
| to | string | ❌ | Target chatId |
|
|
77
|
+
| reminderAll | boolean | ❌ | @mention all (group only) |
|
|
78
|
+
| reminderUserIds | string[] | ❌ | @mention specific users (group only) |
|
|
79
|
+
|
|
80
|
+
### lansenger_send_image_url
|
|
81
|
+
|
|
82
|
+
| Param | Type | Required | Description |
|
|
83
|
+
|----------|----------|----------|----------------------------------------------------|
|
|
84
|
+
| imageUrl | string | ✅ | Directly reachable image URL |
|
|
85
|
+
| caption | string | ❌ | Plain-text caption (no Markdown) |
|
|
86
|
+
| to | string | ❌ | Target chatId |
|
|
87
|
+
|
|
88
|
+
### lansenger_send_link_card
|
|
89
|
+
|
|
90
|
+
| Param | Type | Required | Description |
|
|
91
|
+
|--------------|--------|----------|----------------------------------------------------|
|
|
92
|
+
| title | string | ✅ | Card title |
|
|
93
|
+
| link | string | ✅ | Click-through URL |
|
|
94
|
+
| description | string | ❌ | Card description (API-required, defaults empty) |
|
|
95
|
+
| iconLink | string | ❌ | Icon URL (defaults empty) |
|
|
96
|
+
| pcLink | string | ❌ | PC client link |
|
|
97
|
+
| fromName | string | ❌ | Source name (defaults empty) |
|
|
98
|
+
| fromIconLink | string | ❌ | Source icon URL (defaults empty) |
|
|
99
|
+
| to | string | ❌ | Target chatId |
|
|
100
|
+
|
|
101
|
+
### lansenger_send_app_articles
|
|
102
|
+
|
|
103
|
+
| Param | Type | Required | Description |
|
|
104
|
+
|----------|----------|----------|----------------------------------------------------|
|
|
105
|
+
| articles | object[] | ✅ | Each: { imgUrl, title, url, summary?, pcUrl? } |
|
|
106
|
+
| to | string | ❌ | Target chatId |
|
|
107
|
+
|
|
108
|
+
> ⚠️ Article summary field is `summary`, NOT `description`. `description` is silently ignored by the API.
|
|
109
|
+
|
|
110
|
+
### lansenger_send_app_card
|
|
111
|
+
|
|
112
|
+
| Param | Type | Required | Description |
|
|
113
|
+
|----------------|----------|----------|----------------------------------------------------|
|
|
114
|
+
| bodyTitle | string | ✅ | Card title (supports div-style) |
|
|
115
|
+
| headTitle | string | ❌ | Header title |
|
|
116
|
+
| bodySubTitle | string | ❌ | Subtitle (supports div-style) |
|
|
117
|
+
| bodyContent | string | ❌ | Main content (supports div-style) |
|
|
118
|
+
| signature | string | ❌ | Footer signature |
|
|
119
|
+
| isDynamic | boolean | ❌ | Enable approval workflow (default: false) |
|
|
120
|
+
| 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). These are TWO different things: text color vs dot color. |
|
|
121
|
+
| fields | object[] | ❌ | Key-value pairs (max 10) |
|
|
122
|
+
| links | object[] | ❌ | Links (max 3): { title, url } |
|
|
123
|
+
| cardLink | string | ❌ | Card click-through link |
|
|
124
|
+
| staffId | string | ❌ | Staff openId for sender avatar |
|
|
125
|
+
| headIconUrl | string | ❌ | Header icon URL |
|
|
126
|
+
| to | string | ❌ | Target chatId |
|
|
127
|
+
|
|
128
|
+
### lansenger_update_dynamic_card
|
|
129
|
+
|
|
130
|
+
| Param | Type | Required | Description |
|
|
131
|
+
|----------------|----------|----------|----------------------------------------------------|
|
|
132
|
+
| msgId | string | ✅ | Message ID from original send_app_card response |
|
|
133
|
+
| headStatusInfo | object | ❌ | { description, colour } — description: status TEXT (supports div-style for color). colour: DOT/圆点 color (hex). Independent. |
|
|
134
|
+
| links | object[] | ❌ | Updated links (max 3) |
|
|
135
|
+
| isLastUpdate | boolean | ❌ | True = final state, card becomes static (default: false) |
|
|
136
|
+
|
|
137
|
+
### lansenger_revoke_message
|
|
138
|
+
|
|
139
|
+
| Param | Type | Required | Description |
|
|
140
|
+
|-----------|----------|----------|----------------------------------------------------|
|
|
141
|
+
| messageIds | string[] | ✅ | List of message IDs to revoke |
|
|
142
|
+
| chatType | string | ❌ | bot (default) or group |
|
|
143
|
+
| senderId | string | ❌ | Required if chatType=group |
|
|
144
|
+
|
|
145
|
+
### lansenger_query_groups
|
|
146
|
+
|
|
147
|
+
| Param | Type | Required | Description |
|
|
148
|
+
|------------|---------|----------|----------------------------------------------------|
|
|
149
|
+
| pageOffset | integer | ❌ | Page number (default: 1) |
|
|
150
|
+
| pageSize | integer | ❌ | Groups per page (default: 100) |
|
|
39
151
|
|
|
40
152
|
## CLI Command Reference
|
|
41
153
|
|
|
42
|
-
All commands use `lansenger message <subcommand>`. chatId is case-sensitive.
|
|
154
|
+
All commands use `lansenger message <subcommand>`. chatId is case-sensitive.
|
|
43
155
|
|
|
44
156
|
### lansenger message send-text
|
|
45
157
|
|
|
46
158
|
```bash
|
|
47
|
-
lansenger message send-text <chat_id> <content> [--file <path>] [--
|
|
159
|
+
lansenger message send-text <chat_id> <content> [--file <path>] [--mention-all] [--mention <uid1> [--mention <uid2>]]
|
|
48
160
|
```
|
|
49
161
|
|
|
50
|
-
| Param | Flag | Required | Description |
|
|
51
|
-
|--------------|---------------|----------|--------------------------------------|
|
|
52
|
-
| chat_id | positional | ✅ | Chat ID (user/group) |
|
|
53
|
-
| content | positional | ✅ | Plain text only (NO Markdown) |
|
|
54
|
-
| --file | -f | ❌ | File path to attach |
|
|
55
|
-
| --group | -g | ❌ | Send as group message |
|
|
56
|
-
| --mention-all| | ❌ | @all in group |
|
|
57
|
-
| --mention | | ❌ | User IDs to @mention |
|
|
58
|
-
| --sender-id | | ❌ | Sender staff ID (group) |
|
|
59
|
-
|
|
60
162
|
### lansenger message send-markdown
|
|
61
163
|
|
|
62
164
|
```bash
|
|
63
|
-
lansenger message send-markdown <chat_id> <content> [--mention-all] [--mention <uid>]
|
|
165
|
+
lansenger message send-markdown <chat_id> <content> [--mention-all] [--mention <uid>]
|
|
64
166
|
```
|
|
65
167
|
|
|
66
|
-
| Param | Flag | Required | Description |
|
|
67
|
-
|--------------|---------------|----------|--------------------------------------|
|
|
68
|
-
| chat_id | positional | ✅ | Chat ID |
|
|
69
|
-
| content | positional | ✅ | Markdown content |
|
|
70
|
-
| --mention-all| | ❌ | @all in group |
|
|
71
|
-
| --mention | | ❌ | User IDs to @mention |
|
|
72
|
-
| --group | -g | ❌ | Send as group message |
|
|
73
|
-
| --sender-id | | ❌ | Sender staff ID (group) |
|
|
74
|
-
|
|
75
|
-
> Auto-fallback: if API rejects reminder, retries without reminder.
|
|
76
|
-
|
|
77
168
|
### lansenger message send-file
|
|
169
|
+
|
|
78
170
|
```bash
|
|
79
171
|
lansenger message send-file <chat_id> <file_path> [--caption <text>] [--media-type <1|2|3>]
|
|
80
172
|
```
|
|
81
173
|
|
|
82
|
-
| Param | Flag | Required | Description |
|
|
83
|
-
|-------------|---------------|----------|--------------------------------------|
|
|
84
|
-
| chat_id | positional | ✅ | Chat ID |
|
|
85
|
-
| file_path | positional | ✅ | Absolute local file path |
|
|
86
|
-
| --caption | -c | ❌ | Plain-text caption |
|
|
87
|
-
| --media-type| | ❌ | 1=video, 2=image, 3=file |
|
|
88
|
-
|
|
89
174
|
### lansenger message send-image-url
|
|
175
|
+
|
|
90
176
|
```bash
|
|
91
177
|
lansenger message send-image-url <chat_id> <image_url> [--caption <text>]
|
|
92
178
|
```
|
|
93
179
|
|
|
94
|
-
| Param | Flag | Required | Description |
|
|
95
|
-
|-----------|-----------|----------|--------------------------------------|
|
|
96
|
-
| chat_id | positional | ✅ | Chat ID |
|
|
97
|
-
| image_url | positional | ✅ | Directly reachable image URL |
|
|
98
|
-
| --caption | -c | ❌ | Plain-text caption |
|
|
99
|
-
|
|
100
180
|
### lansenger message send-link-card
|
|
181
|
+
|
|
101
182
|
```bash
|
|
102
183
|
lansenger message send-link-card <chat_id> <title> <link> [--desc <text>] [--icon <url>] [--pc-link <url>] [--from-name <name>] [--from-icon <url>]
|
|
103
184
|
```
|
|
104
185
|
|
|
105
|
-
| Param | Flag | Required | Description |
|
|
106
|
-
|--------------|---------------|----------|--------------------------------------|
|
|
107
|
-
| chat_id | positional | ✅ | Chat ID |
|
|
108
|
-
| title | positional | ✅ | Card title |
|
|
109
|
-
| link | positional | ✅ | Click-through URL |
|
|
110
|
-
| --desc | -d | ❌ | Card description |
|
|
111
|
-
| --icon | | ❌ | Icon URL |
|
|
112
|
-
| --pc-link | | ❌ | PC link URL |
|
|
113
|
-
| --from-name | | ❌ | Source name |
|
|
114
|
-
| --from-icon | | ❌ | Source icon URL |
|
|
115
|
-
|
|
116
186
|
### lansenger message send-app-articles
|
|
187
|
+
|
|
117
188
|
```bash
|
|
118
189
|
lansenger message send-app-articles <chat_id> '{"title":"T","url":"U","imgUrl":"I","summary":"S"}' '{"title":"T2","url":"U2"}'
|
|
119
190
|
```
|
|
120
191
|
|
|
121
|
-
| Param | Type | Required | Description |
|
|
122
|
-
|----------|----------|----------|----------------------------------------------|
|
|
123
|
-
| chat_id | positional | ✅ | Chat ID |
|
|
124
|
-
| articles | positional | ✅ | JSON dicts (multiple). Fields: title, url, imgUrl, summary?, pcUrl? |
|
|
125
|
-
|
|
126
192
|
> ⚠️ Article field is `summary`, NOT `description`. `description` is silently ignored by the API.
|
|
127
193
|
|
|
128
194
|
### lansenger message send-app-card
|
|
195
|
+
|
|
129
196
|
```bash
|
|
130
|
-
lansenger message send-app-card <chat_id> <body_title> [--head-title <t>] [--sub-title <t>] [--content <t>] [--signature <t>] [--card-link <url>] [--
|
|
197
|
+
lansenger message send-app-card <chat_id> <body_title> [--head-title <t>] [--sub-title <t>] [--content <t>] [--signature <t>] [--card-link <url>] [--dynamic] [--staff-id <id>] [--head-icon <url>] [--status-desc <div>] [--status-colour <hex>] [--field <json>] [--link <json>]
|
|
131
198
|
```
|
|
132
199
|
|
|
133
|
-
|
|
134
|
-
|-----------------|-------------------|----------|----------------------------------------------|
|
|
135
|
-
| chat_id | positional | ✅ | Chat ID |
|
|
136
|
-
| body_title | positional | ✅ | Card body title (supports div-style) |
|
|
137
|
-
| --head-title | | ❌ | Header title |
|
|
138
|
-
| --sub-title | | ❌ | Subtitle (supports div-style) |
|
|
139
|
-
| --content | | ❌ | Main content (supports div-style) |
|
|
140
|
-
| --signature | | ❌ | Footer signature |
|
|
141
|
-
| --card-link | | ❌ | Card click-through link |
|
|
142
|
-
| --pc-card-link | | ❌ | PC card link |
|
|
143
|
-
| --pad-card-link | | ❌ | Pad card link |
|
|
144
|
-
| --dynamic | | ❌ | Enable approval workflow |
|
|
145
|
-
| --staff-id | | ❌ | Staff openId for sender avatar |
|
|
146
|
-
| --head-icon | | ❌ | Header icon URL |
|
|
147
|
-
| --status-desc | | ❌ | Status description (div-style, max 30 bytes) |
|
|
148
|
-
| --status-colour | | ❌ | Status DOT colour (hex, e.g. #FFB116) |
|
|
149
|
-
| --field | | ❌ | Field as JSON {\"key\":\"k\",\"value\":\"v\"} |
|
|
150
|
-
| --link | | ❌ | Link as JSON {\"title\":\"T\",\"url\":\"U\"} |
|
|
151
|
-
|
|
152
|
-
**div-style rules:**
|
|
153
|
-
- `color`: hex (e.g. #333, #007BFF)
|
|
154
|
-
- `font-size`: **MUST use pt** (12pt–36pt). px causes "invalid bodyContent" error.
|
|
155
|
-
- `text-align`: left, center, right
|
|
156
|
-
- `text-indent`: **MUST use 0em** — bare 0 causes silent failure
|
|
157
|
-
- Example: `<div style="color:#333;font-size:14pt;text-indent:0em;text-align:left">Content</div>`
|
|
158
|
-
|
|
159
|
-
**headStatusInfo**: `--status-desc` = status TEXT (supports div-style for text color), `--status-colour` = DOT/圆点 colour. These are TWO different things: text color vs dot color.
|
|
200
|
+
**headStatusInfo**: `--status-desc` = status TEXT (supports div-style for text color), `--status-colour` = DOT/圆点 colour (hex). These are TWO different things: text color vs dot color.
|
|
160
201
|
|
|
161
202
|
### lansenger message update-dynamic-card
|
|
203
|
+
|
|
162
204
|
```bash
|
|
163
205
|
lansenger message update-dynamic-card <msg_id> [--last] [--status-desc <div>] [--status-colour <hex>] [--link <json>]
|
|
164
206
|
```
|
|
165
207
|
|
|
166
|
-
| Param | Flag | Required | Description |
|
|
167
|
-
|-----------------|-------------------|----------|----------------------------------------------|
|
|
168
|
-
| msg_id | positional | ✅ | Message ID from original send-app-card |
|
|
169
|
-
| --last | | ❌ | Mark as last update (card becomes static) |
|
|
170
|
-
| --status-desc | | ❌ | New status description (div-style) |
|
|
171
|
-
| --status-colour | | ❌ | New status DOT colour (hex) |
|
|
172
|
-
| --link | | ❌ | Updated link as JSON {\"title\":\"T\",\"url\":\"U\"} |
|
|
173
|
-
|
|
174
208
|
### lansenger message revoke
|
|
209
|
+
|
|
175
210
|
```bash
|
|
176
211
|
lansenger message revoke <msg_id1> <msg_id2> [--chat-type bot|group] [--sender-id <id>]
|
|
177
212
|
```
|
|
178
213
|
|
|
179
|
-
| Param | Flag | Required | Description |
|
|
180
|
-
|-------------|---------------|----------|--------------------------------------|
|
|
181
|
-
| message_ids | positional | ✅ | Message IDs to revoke |
|
|
182
|
-
| --chat-type | | ❌ | bot (default) or group |
|
|
183
|
-
| --sender-id | | ❌ | Required if chat-type=group |
|
|
184
|
-
|
|
185
214
|
### lansenger message query-groups
|
|
215
|
+
|
|
186
216
|
```bash
|
|
187
217
|
lansenger message query-groups [--page <n>] [--size <n>]
|
|
188
218
|
```
|
|
189
219
|
|
|
190
|
-
| Param | Flag | Required | Description |
|
|
191
|
-
|-------------|----------|----------|--------------------------------------|
|
|
192
|
-
| --page | -p | ❌ | Page offset (default: 1) |
|
|
193
|
-
| --size | -s | ❌ | Page size (default: 100) |
|
|
194
|
-
|
|
195
220
|
## Approval Workflow Pattern
|
|
196
221
|
|
|
222
|
+
**Via tools:**
|
|
223
|
+
1. `lansenger_send_app_card(bodyTitle="...", isDynamic=true, headStatusInfo={description: '<div style="color:#FFB116">待审批</div>', colour: "#FFB116"})`
|
|
224
|
+
2. `lansenger_update_dynamic_card(msgId="<from step 1>", headStatusInfo={description: '<div style="color:#198754">已批准</div>', colour: "#198754"}, isLastUpdate=true)`
|
|
225
|
+
|
|
226
|
+
**Via CLI:**
|
|
197
227
|
```bash
|
|
198
|
-
# Step 1: Send approval card
|
|
199
228
|
lansenger message send-app-card <chat_id> "审批" --dynamic --status-desc '<div style="color:#FFB116">待审批</div>' --status-colour "#FFB116"
|
|
200
|
-
|
|
201
|
-
# Step 2: User approves → Update to approved
|
|
202
229
|
lansenger message update-dynamic-card <msg_id> --last --status-desc '<div style="color:#198754">已批准</div>' --status-colour "#198754"
|
|
203
|
-
|
|
204
|
-
# Step 3: User denies → Update to denied
|
|
205
|
-
lansenger message update-dynamic-card <msg_id> --last --status-desc '<div style="color:#dc3545">已拒绝</div>' --status-colour "#dc3545"
|
|
206
230
|
```
|
|
207
231
|
|
|
208
232
|
Status colors: #FFB116 (pending), #198754 (approved), #dc3545 (denied)
|
|
209
233
|
|
|
210
234
|
## @Mention Rules
|
|
211
235
|
|
|
212
|
-
1. **Always include "@姓名" in message text** — reminder sends the push notification, "@姓名" makes it visible in the message. Especially important in group chat
|
|
213
|
-
2. **reminder is optional** — use it when you want someone to receive a push notification.
|
|
236
|
+
1. **Always include "@姓名" in message text** — reminder sends the push notification, "@姓名" makes it visible in the message itself. Especially important in **group chat**.
|
|
237
|
+
2. **reminder is optional** — use it when you want someone to receive a push notification about your message.
|
|
214
238
|
|
|
215
239
|
## Inbound Messages
|
|
216
240
|
|
|
@@ -218,22 +242,23 @@ Status colors: #FFB116 (pending), #198754 (approved), #dc3545 (denied)
|
|
|
218
242
|
|------------|---------------------------------------------------|
|
|
219
243
|
| text | Plain text content |
|
|
220
244
|
| formatText | Markdown text content |
|
|
221
|
-
| image |
|
|
222
|
-
| video |
|
|
223
|
-
| file |
|
|
224
|
-
| voice |
|
|
225
|
-
| position |
|
|
226
|
-
| card |
|
|
227
|
-
| sticker |
|
|
245
|
+
| image | Local file paths (use read tool to view) |
|
|
246
|
+
| video | Local file paths |
|
|
247
|
+
| file | Local file paths |
|
|
248
|
+
| voice | Local file path (.amr) |
|
|
249
|
+
| position | Location name, address, lat/long |
|
|
250
|
+
| card | Contact card with staffId |
|
|
251
|
+
| sticker | Sticker/emoji message |
|
|
228
252
|
|
|
229
253
|
## Common Pitfalls
|
|
230
254
|
|
|
231
|
-
| Pitfall
|
|
232
|
-
|
|
233
|
-
| Raw Markdown in
|
|
234
|
-
| MEDIA: tag for file delivery
|
|
235
|
-
| AppArticles `description` field
|
|
236
|
-
| AppCard font-size: px
|
|
237
|
-
| AppCard text-indent: 0
|
|
238
|
-
| headStatusInfo div wrapping
|
|
239
|
-
| Message too long
|
|
255
|
+
| Pitfall | Fix |
|
|
256
|
+
|--------------------------------|----------------------------------------------------------------------------------|
|
|
257
|
+
| Raw Markdown in text tool/CLI | Never do this — shows as ugly source code. Write normally for Markdown. |
|
|
258
|
+
| MEDIA: tag for file delivery | ⚠️ Currently broken for ALL files. Use `lansenger_send_file` instead. |
|
|
259
|
+
| AppArticles `description` field | Use `summary`, not `description`. `description` is silently ignored by the API. |
|
|
260
|
+
| AppCard `font-size: px` | Use `pt` units (12pt–36pt). px causes API "invalid bodyContent" error. |
|
|
261
|
+
| AppCard `text-indent: 0` | Use `0em` with unit. Bare 0 causes silent failure. |
|
|
262
|
+
| headStatusInfo div wrapping | description supports div-style for color. colour is the DOT/圆点 color. Separate. |
|
|
263
|
+
| Message too long | ~4000 character limit. Split into multiple messages. |
|
|
264
|
+
| Tools not available | Install `lansenger-tools` plugin: `openclaw plugins install @lansenger-pm/openclaw-lansenger-tools` |
|