@tuanminhhole

Openclaw Zalo Mod

Zero-token Zalo group moderation plugin for OpenClaw — slash commands, anti-spam, warn system, and memory integration.

Current version
v2.4.6
code-pluginCommunitysource-linked

🛡️ zalo-mod — Zero-Token Zalo Group Moderation

OpenClaw runtime plugin for Zalo group administration. Handles moderation, slash commands, and anti-spam with zero LLM token cost. Only @mention queries are forwarded to the AI agent.

License: MIT OpenClaw Plugin

🇻🇳 Đọc bằng tiếng Việt


✨ Features

FeatureToken CostDescription
Slash Commands0/noi-quy, /menu, /huong-dan, /groupid, /ownerid, /report, /rules
Warn System0/warn @name [reason] — track warnings per member
Anti-Spam0Auto-detect repeated messages, link spam, emoji flood
Admin Notes0/note [text] — admin-only notes
Memory Sync0/memory — save full digest to skills/memory/
Smart Q&A0Auto-answer "who's warned?" "violations?" from local data
Sticker Detection0Transform raw sticker JSON to [Sticker] for agent
@Mention✅ uses tokensForward to LLM only for real questions

🏗️ Architecture

Incoming Zalo message
    │
    ├─ /slash command     → Plugin handles locally (0 tokens)
    ├─ Spam detected      → Log + block silently (0 tokens)
    ├─ Sticker/media      → Transform to [Sticker] (0 tokens)
    ├─ "Who's warned?"    → Plugin answers from store (0 tokens)
    │
    └─ @BotName question  → Forward to LLM agent (uses tokens)

📦 Installation

From ClawHub (recommended)

openclaw plugins install zalo-mod

Manual

  1. Copy the plugin to your extensions/ directory:
# Windows
xcopy /E /I openclaw-zalo-mod %OPENCLAW_HOME%\extensions\zalo-mod

# Linux / macOS
cp -r openclaw-zalo-mod ~/.openclaw/extensions/zalo-mod
  1. Restart the gateway:
openclaw gateway restart

Path resolution

zalo-mod does not require a .env file in native installs. At runtime it resolves OpenClaw config in this order:

  1. OPENCLAW_HOME environment variable, used by Docker/openclaw-setup.
  2. The plugin install path, usually {OPENCLAW_HOME}/extensions/zalo-mod.

After the bot receives a group message, run /groupid in that group. The plugin scans saved Zalo sessions and writes both watchGroupIds and groupNames to openclaw.json.

🛑 Anti-Spam Detection

TypeDetection
Repeat SpamSame message sent N times within the time window
Link SpamMessages containing suspicious URLs (bit.ly, tinyurl, affiliate links)
Emoji FloodMessages with 5+ consecutive emojis

Violations are logged to the store and synced to violations.md.

🤖 Smart Auto-Answer

When someone @mentions the bot with common group management questions, zalo-mod answers directly from the local store — no LLM tokens used:

Question PatternSource
"Who's warned?" / "Ai bị warn?"store.getWarned()
"Violations?" / "Vi phạm?"store.getViolations()
"Who's admin?" / "Admin là ai?"Config response

All other @mention questions are forwarded to the LLM agent.

🔧 Requirements

  • OpenClaw >= 2026.3.24
  • zalouser channel configured and authenticated
  • Node.js >= 20

📄 License

MIT — see LICENSE

Source and release

Source repository

tuanminhhole/openclaw-zalo-mod

Open repo

Source commit

d841d1bbb95066692de0914fec22452a9628a00f

View commit

Install command

openclaw plugins install clawhub:@tuanminhhole/openclaw-zalo-mod

Metadata

  • Package: @tuanminhhole/openclaw-zalo-mod
  • Created: 2026/05/05
  • Updated: 2026/05/05
  • Executes code: Yes
  • Source tag: d841d1bbb95066692de0914fec22452a9628a00f

Compatibility

  • Built with OpenClaw: 2026.3.24
  • Plugin API range: >=2026.3.24
  • Tags: latest
  • Files: 12