Files
openclaw/extensions/zalouser
darkamenosa a6711afdc2 feat(zalouser): add markdown-to-Zalo text style parsing (#43324)
* feat(zalouser): add markdown-to-Zalo text style parsing

Parse markdown formatting (bold, italic, strikethrough, headings, lists,
code blocks, blockquotes, custom color/style tags) into Zalo native
TextStyle ranges so outbound messages render with rich formatting.

- Add text-styles.ts with parseZalouserTextStyles() converter
- Wire markdown mode into send pipeline (sendMessageZalouser)
- Export TextStyle enum and Style type from zca-client
- Add textMode/textStyles to ZaloSendOptions
- Pass textStyles through sendZaloTextMessage to zca-js API
- Enable textMode:"markdown" in outbound sendText/sendMedia and monitor
- Add comprehensive tests for parsing, send, and channel integration

* fix(zalouser): harden markdown text parsing

* fix(zalouser): mirror zca-js text style types

* fix(zalouser): support tilde fenced code blocks

* fix(zalouser): handle quoted fenced code blocks

* fix(zalouser): preserve literal quote lines in code fences

* fix(zalouser): support indented quoted fences

* fix(zalouser): preserve quoted markdown blocks

* fix(zalouser): rechunk formatted messages

* fix(zalouser): preserve markdown structure across chunks

* fix(zalouser): honor chunk limits and CRLF fences
2026-03-12 16:24:15 +07:00
..
2026-03-12 04:01:57 +00:00
2026-03-12 04:01:57 +00:00

@openclaw/zalouser

OpenClaw extension for Zalo Personal Account messaging via native zca-js integration.

Warning: Using Zalo automation may result in account suspension or ban. Use at your own risk. This is an unofficial integration.

Features

  • Channel plugin integration with onboarding + QR login
  • In-process listener/sender via zca-js (no external CLI)
  • Multi-account support
  • Agent tool integration (zalouser)
  • DM/group policy support

Prerequisites

  • OpenClaw Gateway
  • Zalo mobile app (for QR login)

No external zca, openzca, or zca-cli binary is required.

Install

Option A: npm

openclaw plugins install @openclaw/zalouser

Option B: local source checkout

openclaw plugins install ./extensions/zalouser
cd ./extensions/zalouser && pnpm install

Restart the Gateway after install.

Quick start

Login (QR)

openclaw channels login --channel zalouser

Scan the QR code with the Zalo app on your phone.

Enable channel

channels:
  zalouser:
    enabled: true
    dmPolicy: pairing # pairing | allowlist | open | disabled

Send a message

openclaw message send --channel zalouser --target <threadId> --message "Hello from OpenClaw"

Configuration

Basic:

channels:
  zalouser:
    enabled: true
    dmPolicy: pairing

Multi-account:

channels:
  zalouser:
    enabled: true
    defaultAccount: default
    accounts:
      default:
        enabled: true
        profile: default
      work:
        enabled: true
        profile: work

Useful commands

openclaw channels login --channel zalouser
openclaw channels login --channel zalouser --account work
openclaw channels status --probe
openclaw channels logout --channel zalouser

openclaw directory self --channel zalouser
openclaw directory peers list --channel zalouser --query "name"
openclaw directory groups list --channel zalouser --query "work"
openclaw directory groups members --channel zalouser --group-id <id>

Agent tool

The extension registers a zalouser tool for AI agents.

Available actions: send, image, link, friends, groups, me, status

Troubleshooting

  • Login not persisted: openclaw channels logout --channel zalouser && openclaw channels login --channel zalouser
  • Probe status: openclaw channels status --probe
  • Name resolution issues (allowlist/groups): use numeric IDs or exact Zalo names

Credits

Built on zca-js.