create-openclaw-bot 4.1.4 → 5.0.0

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/zalo_doc_tmp.md DELETED
Binary file
package/zalo_docs.md DELETED
Binary file
package/zalo_docs_utf8.md DELETED
@@ -1,243 +0,0 @@
1
- ---
2
- summary: "Zalo bot support status, capabilities, and configuration"
3
- read_when:
4
- - Working on Zalo features or webhooks
5
- title: "Zalo"
6
- ---
7
-
8
- # Zalo (Bot API)
9
-
10
- Status: experimental. DMs are supported. The [Capabilities](#capabilities) section below reflects current Marketplace-bot behavior.
11
-
12
- ## Plugin required
13
-
14
- Zalo ships as a plugin and is not bundled with the core install.
15
-
16
- - Install via CLI: `openclaw plugins install @openclaw/zalo`
17
- - Or select **Zalo** during setup and confirm the install prompt
18
- - Details: [Plugins](/tools/plugin)
19
-
20
- ## Quick setup (beginner)
21
-
22
- 1. Install the Zalo plugin:
23
- - From a source checkout: `openclaw plugins install ./extensions/zalo`
24
- - From npm (if published): `openclaw plugins install @openclaw/zalo`
25
- - Or pick **Zalo** in setup and confirm the install prompt
26
- 2. Set the token:
27
- - Env: `ZALO_BOT_TOKEN=...`
28
- - Or config: `channels.zalo.accounts.default.botToken: "..."`.
29
- 3. Restart the gateway (or finish setup).
30
- 4. DM access is pairing by default; approve the pairing code on first contact.
31
-
32
- Minimal config:
33
-
34
- ```json5
35
- {
36
- channels: {
37
- zalo: {
38
- enabled: true,
39
- accounts: {
40
- default: {
41
- botToken: "12345689:abc-xyz",
42
- dmPolicy: "pairing",
43
- },
44
- },
45
- },
46
- },
47
- }
48
- ```
49
-
50
- ## What it is
51
-
52
- Zalo is a Vietnam-focused messaging app; its Bot API lets the Gateway run a bot for 1:1 conversations.
53
- It is a good fit for support or notifications where you want deterministic routing back to Zalo.
54
-
55
- This page reflects current OpenClaw behavior for **Zalo Bot Creator / Marketplace bots**.
56
- **Zalo Official Account (OA) bots** are a different Zalo product surface and may behave differently.
57
-
58
- - A Zalo Bot API channel owned by the Gateway.
59
- - Deterministic routing: replies go back to Zalo; the model never chooses channels.
60
- - DMs share the agent's main session.
61
- - The [Capabilities](#capabilities) section below shows current Marketplace-bot support.
62
-
63
- ## Setup (fast path)
64
-
65
- ### 1) Create a bot token (Zalo Bot Platform)
66
-
67
- 1. Go to [https://bot.zaloplatforms.com](https://bot.zaloplatforms.com) and sign in.
68
- 2. Create a new bot and configure its settings.
69
- 3. Copy the full bot token (typically `numeric_id:secret`). For Marketplace bots, the usable runtime token may appear in the bot's welcome message after creation.
70
-
71
- ### 2) Configure the token (env or config)
72
-
73
- Example:
74
-
75
- ```json5
76
- {
77
- channels: {
78
- zalo: {
79
- enabled: true,
80
- accounts: {
81
- default: {
82
- botToken: "12345689:abc-xyz",
83
- dmPolicy: "pairing",
84
- },
85
- },
86
- },
87
- },
88
- }
89
- ```
90
-
91
- If you later move to a Zalo bot surface where groups are available, you can add group-specific config such as `groupPolicy` and `groupAllowFrom` explicitly. For current Marketplace-bot behavior, see [Capabilities](#capabilities).
92
-
93
- Env option: `ZALO_BOT_TOKEN=...` (works for the default account only).
94
-
95
- Multi-account support: use `channels.zalo.accounts` with per-account tokens and optional `name`.
96
-
97
- 3. Restart the gateway. Zalo starts when a token is resolved (env or config).
98
- 4. DM access defaults to pairing. Approve the code when the bot is first contacted.
99
-
100
- ## How it works (behavior)
101
-
102
- - Inbound messages are normalized into the shared channel envelope with media placeholders.
103
- - Replies always route back to the same Zalo chat.
104
- - Long-polling by default; webhook mode available with `channels.zalo.webhookUrl`.
105
-
106
- ## Limits
107
-
108
- - Outbound text is chunked to 2000 characters (Zalo API limit).
109
- - Media downloads/uploads are capped by `channels.zalo.mediaMaxMb` (default 5).
110
- - Streaming is blocked by default due to the 2000 char limit making streaming less useful.
111
-
112
- ## Access control (DMs)
113
-
114
- ### DM access
115
-
116
- - Default: `channels.zalo.dmPolicy = "pairing"`. Unknown senders receive a pairing code; messages are ignored until approved (codes expire after 1 hour).
117
- - Approve via:
118
- - `openclaw pairing list zalo`
119
- - `openclaw pairing approve zalo <CODE>`
120
- - Pairing is the default token exchange. Details: [Pairing](/channels/pairing)
121
- - `channels.zalo.allowFrom` accepts numeric user IDs (no username lookup available).
122
-
123
- ## Access control (Groups)
124
-
125
- For **Zalo Bot Creator / Marketplace bots**, group support was not available in practice because the bot could not be added to a group at all.
126
-
127
- That means the group-related config keys below exist in the schema, but were not usable for Marketplace bots:
128
-
129
- - `channels.zalo.groupPolicy` controls group inbound handling: `open | allowlist | disabled`.
130
- - `channels.zalo.groupAllowFrom` restricts which sender IDs can trigger the bot in groups.
131
- - If `groupAllowFrom` is unset, Zalo falls back to `allowFrom` for sender checks.
132
- - Runtime note: if `channels.zalo` is missing entirely, runtime still falls back to `groupPolicy="allowlist"` for safety.
133
-
134
- The group policy values (when group access is available on your bot surface) are:
135
-
136
- - `groupPolicy: "disabled"` ΓÇö blocks all group messages.
137
- - `groupPolicy: "open"` ΓÇö allows any group member (mention-gated).
138
- - `groupPolicy: "allowlist"` ΓÇö fail-closed default; only allowed senders are accepted.
139
-
140
- If you are using a different Zalo bot product surface and have verified working group behavior, document that separately rather than assuming it matches the Marketplace-bot flow.
141
-
142
- ## Long-polling vs webhook
143
-
144
- - Default: long-polling (no public URL required).
145
- - Webhook mode: set `channels.zalo.webhookUrl` and `channels.zalo.webhookSecret`.
146
- - The webhook secret must be 8-256 characters.
147
- - Webhook URL must use HTTPS.
148
- - Zalo sends events with `X-Bot-Api-Secret-Token` header for verification.
149
- - Gateway HTTP handles webhook requests at `channels.zalo.webhookPath` (defaults to the webhook URL path).
150
- - Requests must use `Content-Type: application/json` (or `+json` media types).
151
- - Duplicate events (`event_name + message_id`) are ignored for a short replay window.
152
- - Burst traffic is rate-limited per path/source and may return HTTP 429.
153
-
154
- **Note:** getUpdates (polling) and webhook are mutually exclusive per Zalo API docs.
155
-
156
- ## Supported message types
157
-
158
- For a quick support snapshot, see [Capabilities](#capabilities). The notes below add detail where the behavior needs extra context.
159
-
160
- - **Text messages**: Full support with 2000 character chunking.
161
- - **Plain URLs in text**: Behave like normal text input.
162
- - **Link previews / rich link cards**: See the Marketplace-bot status in [Capabilities](#capabilities); they did not reliably trigger a reply.
163
- - **Image messages**: See the Marketplace-bot status in [Capabilities](#capabilities); inbound image handling was unreliable (typing indicator without a final reply).
164
- - **Stickers**: See the Marketplace-bot status in [Capabilities](#capabilities).
165
- - **Voice notes / audio files / video / generic file attachments**: See the Marketplace-bot status in [Capabilities](#capabilities).
166
- - **Unsupported types**: Logged (for example, messages from protected users).
167
-
168
- ## Capabilities
169
-
170
- This table summarizes current **Zalo Bot Creator / Marketplace bot** behavior in OpenClaw.
171
-
172
- | Feature | Status |
173
- | --------------------------- | --------------------------------------- |
174
- | Direct messages | ✅ Supported |
175
- | Groups | ❌ Not available for Marketplace bots |
176
- | Media (inbound images) | ⚠️ Limited / verify in your environment |
177
- | Media (outbound images) | ⚠️ Not re-tested for Marketplace bots |
178
- | Plain URLs in text | ✅ Supported |
179
- | Link previews | ⚠️ Unreliable for Marketplace bots |
180
- | Reactions | ❌ Not supported |
181
- | Stickers | ⚠️ No agent reply for Marketplace bots |
182
- | Voice notes / audio / video | ⚠️ No agent reply for Marketplace bots |
183
- | File attachments | ⚠️ No agent reply for Marketplace bots |
184
- | Threads | ❌ Not supported |
185
- | Polls | ❌ Not supported |
186
- | Native commands | ❌ Not supported |
187
- | Streaming | ⚠️ Blocked (2000 char limit) |
188
-
189
- ## Delivery targets (CLI/cron)
190
-
191
- - Use a chat id as the target.
192
- - Example: `openclaw message send --channel zalo --target 123456789 --message "hi"`.
193
-
194
- ## Troubleshooting
195
-
196
- **Bot doesn't respond:**
197
-
198
- - Check that the token is valid: `openclaw channels status --probe`
199
- - Verify the sender is approved (pairing or allowFrom)
200
- - Check gateway logs: `openclaw logs --follow`
201
-
202
- **Webhook not receiving events:**
203
-
204
- - Ensure webhook URL uses HTTPS
205
- - Verify secret token is 8-256 characters
206
- - Confirm the gateway HTTP endpoint is reachable on the configured path
207
- - Check that getUpdates polling is not running (they're mutually exclusive)
208
-
209
- ## Configuration reference (Zalo)
210
-
211
- Full configuration: [Configuration](/gateway/configuration)
212
-
213
- The flat top-level keys (`channels.zalo.botToken`, `channels.zalo.dmPolicy`, and similar) are a legacy single-account shorthand. Prefer `channels.zalo.accounts.<id>.*` for new configs. Both forms are still documented here because they exist in the schema.
214
-
215
- Provider options:
216
-
217
- - `channels.zalo.enabled`: enable/disable channel startup.
218
- - `channels.zalo.botToken`: bot token from Zalo Bot Platform.
219
- - `channels.zalo.tokenFile`: read token from a regular file path. Symlinks are rejected.
220
- - `channels.zalo.dmPolicy`: `pairing | allowlist | open | disabled` (default: pairing).
221
- - `channels.zalo.allowFrom`: DM allowlist (user IDs). `open` requires `"*"`. The wizard will ask for numeric IDs.
222
- - `channels.zalo.groupPolicy`: `open | allowlist | disabled` (default: allowlist). Present in config; see [Capabilities](#capabilities) and [Access control (Groups)](#access-control-groups) for current Marketplace-bot behavior.
223
- - `channels.zalo.groupAllowFrom`: group sender allowlist (user IDs). Falls back to `allowFrom` when unset.
224
- - `channels.zalo.mediaMaxMb`: inbound/outbound media cap (MB, default 5).
225
- - `channels.zalo.webhookUrl`: enable webhook mode (HTTPS required).
226
- - `channels.zalo.webhookSecret`: webhook secret (8-256 chars).
227
- - `channels.zalo.webhookPath`: webhook path on the gateway HTTP server.
228
- - `channels.zalo.proxy`: proxy URL for API requests.
229
-
230
- Multi-account options:
231
-
232
- - `channels.zalo.accounts.<id>.botToken`: per-account token.
233
- - `channels.zalo.accounts.<id>.tokenFile`: per-account regular token file. Symlinks are rejected.
234
- - `channels.zalo.accounts.<id>.name`: display name.
235
- - `channels.zalo.accounts.<id>.enabled`: enable/disable account.
236
- - `channels.zalo.accounts.<id>.dmPolicy`: per-account DM policy.
237
- - `channels.zalo.accounts.<id>.allowFrom`: per-account allowlist.
238
- - `channels.zalo.accounts.<id>.groupPolicy`: per-account group policy. Present in config; see [Capabilities](#capabilities) and [Access control (Groups)](#access-control-groups) for current Marketplace-bot behavior.
239
- - `channels.zalo.accounts.<id>.groupAllowFrom`: per-account group sender allowlist.
240
- - `channels.zalo.accounts.<id>.webhookUrl`: per-account webhook URL.
241
- - `channels.zalo.accounts.<id>.webhookSecret`: per-account webhook secret.
242
- - `channels.zalo.accounts.<id>.webhookPath`: per-account webhook path.
243
- - `channels.zalo.accounts.<id>.proxy`: per-account proxy URL.