@lansenger-pm/openclaw-lansenger-channel 2.0.3 → 2.0.5
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lansenger-messaging
|
|
3
|
-
version: 2.0.
|
|
3
|
+
version: 2.0.5
|
|
4
4
|
category: communication
|
|
5
5
|
description: How to communicate effectively on Lansenger (蓝信) — message types, formatting rules, media, cards, approvals, and pitfalls
|
|
6
6
|
trigger: When the current session channel is lansenger, or when you need to send a message, file, image, card, or approval via Lansenger
|
|
@@ -123,28 +123,40 @@ openclaw pairing approve lansenger <code>
|
|
|
123
123
|
|
|
124
124
|
This is the correct model for personal bots — they only receive DMs from approved users.
|
|
125
125
|
|
|
126
|
-
## Sending Files to Users
|
|
126
|
+
## Sending Files to Users (CRITICAL)
|
|
127
127
|
|
|
128
|
-
When you create a file
|
|
128
|
+
When you create or reference a file that the user should receive on Lansenger, **you MUST send it explicitly via `sendAttachment`** — writing or reading a file alone does NOT deliver it to the user.
|
|
129
129
|
|
|
130
|
-
Use
|
|
130
|
+
### Use `sendAttachment` action
|
|
131
131
|
|
|
132
132
|
```
|
|
133
133
|
Action: sendAttachment
|
|
134
134
|
Parameters:
|
|
135
|
-
to: <Lansenger user ID or chat ID>
|
|
136
|
-
filePath: <absolute path to the file
|
|
135
|
+
to: <Lansenger user ID or chat ID> (required)
|
|
136
|
+
filePath: <absolute path to the file> (required)
|
|
137
137
|
caption: <optional plain-text caption — NO Markdown>
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
### ⚠️ Files MUST be in the workspace directory
|
|
141
|
+
|
|
142
|
+
`sendAttachment` and `MEDIA:` tags only work for files inside `~/.openclaw/workspace/`. Files outside the workspace (e.g. `~/Documents/`, `~/Desktop/`, `/tmp/`) are **silently dropped** — the user will never receive them.
|
|
143
|
+
|
|
144
|
+
**If the source file is outside the workspace**, you MUST copy it first:
|
|
145
|
+
1. Use the `bash` tool to copy: `cp /path/to/source/file ~/.openclaw/workspace/file`
|
|
146
|
+
2. Then use `sendAttachment` with the workspace path: `filePath: ~/.openclaw/workspace/file`
|
|
147
|
+
|
|
148
|
+
### Typical flow
|
|
149
|
+
|
|
150
|
+
1. `write` tool → creates file in workspace (e.g. `~/.openclaw/workspace/report.md`)
|
|
151
|
+
2. `sendAttachment` action → delivers file to the user on Lansenger
|
|
152
|
+
|
|
153
|
+
### Rules
|
|
143
154
|
|
|
144
|
-
**Rules:**
|
|
145
155
|
- Always use absolute paths for `filePath`
|
|
146
156
|
- `caption` is plain text only (Markdown will NOT render in attachment messages)
|
|
147
157
|
- If you need both formatted explanation AND a file attachment, send the formatted text first (Markdown works), then `sendAttachment` separately for the file
|
|
158
|
+
- **NEVER use `MEDIA:` tags for files outside the workspace** — they are silently dropped without any error
|
|
159
|
+
- For workspace files, `sendAttachment` is more reliable than `MEDIA:` tags
|
|
148
160
|
- Supported file types: images (.jpg/.png/.gif/.webp), videos (.mp4/.mov), documents (.pdf/.md/.txt/.zip), etc.
|
|
149
161
|
|
|
150
162
|
## Critical Pitfalls
|