Skip to content

Messages

ardennguyen edited this page Jun 30, 2026 · 3 revisions

Messages (msg)

Command Description
msg send <threadId> <text> [-t 0|1] [--md] [--style specs...] Send text message
msg send-image <threadId> <paths...> [-t 0|1] [-m caption] Send images
msg send-file <threadId> <paths...> [-t 0|1] [-m caption] Send files
msg send-card <threadId> <userId> [-t 0|1] [--phone NUM] Send contact card
msg send-bank <threadId> <accountNum> -b BANK [-n name] [-t 0|1] Send bank card
msg send-qr-transfer <threadId> <accountNum> -b BANK [-a amount] [-m content] [--template tpl] Send VietQR transfer
msg send-voice <threadId> <voiceUrl> [-t 0|1] [--ttl ms] Send voice from URL
msg send-link <threadId> <url> [-m caption] [-t 0|1] Send link with preview
msg send-video <threadId> <videoUrl> --thumb <url> [-m caption] [-d ms] [-W px] [-H px] Send video from URL
msg sticker <threadId> <keyword> [-t 0|1] Search and send sticker
msg sticker-list <keyword> Search stickers (returns IDs)
msg sticker-detail <stickerIds...> Get sticker details
msg sticker-category <categoryId> Get sticker category
msg react <msgId> <threadId> <emoji> [-t 0|1] React to a message
msg delete <msgId> <threadId> [-t 0|1] Delete a message
msg forward <msgId> <threadId> [-t 0|1] Forward a message
msg history <threadId> [-n limit] [-t 0|1] [--no-cache] Message history (cache-first; --no-cache forces live + backfill)
msg search <query> [-t threadId] [-n limit] Full-text search across cached messages (FTS5, offline)

Text Formatting

Markdown mode (--md)

zalo-agent msg send <threadId> "**Bold** *Italic* __Underline__ ~~Strike~~ {red:Red} {big:BIG}" --md
Syntax Style
**text** Bold
*text* Italic
__text__ Underline
~~text~~ Strikethrough
{red:text} Red
{orange:text} Orange
{yellow:text} Yellow
{green:text} Green
{big:text} Large font
{small:text} Small font

Manual style (--style)

# Format: start:len:style
zalo-agent msg send <threadId> "Hello World" --style 0:5:bold 6:5:italic

Reactions

Codes: :> (haha), /-heart (heart), /-strong (like), :o (wow), :-(((cry), :-h (angry)

zalo-agent msg react <msgId> <threadId> "/-heart"

Local Cache (v1.1.0)

# Read from cache (instant if listen/mcp start has been running)
zalo-agent msg history <threadId>

# Force live fetch from Zalo + backfill cache
zalo-agent msg history <threadId> --no-cache

# Full-text search across all cached messages
zalo-agent msg search "birthday"
zalo-agent msg search "meeting" -t <threadId>   # Limit to one thread

Clone this wiki locally