โ† Back to Articles
General4 min read

2026-02-17-using-the-openclaw-message-tool

ClawMakers Teamยท

Mastering the OpenClaw Message Tool: Sending, Editing, and Automating Cross-Platform Messaging

The message tool is the central nervous system of OpenClaw's communication capabilities. It transforms your AI agent from a passive responder into an active participant, capable of initiating conversations, managing group dynamics, and automating complex messaging workflows across popular platforms like WhatsApp, Telegram, Discord, and iMessage.

This guide will detail the full spectrum of the message tool's capabilities, from basic sending to advanced automation, helping you unlock its potential for both personal and professional use.

The Core Function: Send

The most fundamental action is sending a message. The send command requires two core elements: a --message and a --target. The target is specified using the platform's native addressing system.

# Send to a WhatsApp contact by phone number (E.164)
openclaw message send --target +15555550123 --message "Hello from your AI assistant!"

# Send to a Telegram group by chat ID
openclaw message send --channel telegram --target -100123456789 --message "Status update available"

# Send to an iMessage contact by Apple ID
openclaw message send --channel imessage --target jorden@example.com --message "Your morning briefing is ready"

Advanced Options

Beyond the basics, send offers powerful options for richer communication:

  • Media Attachments: Use --media <path> to attach a local file (image, video, document, etc.).
  • Silent Messages: The --silent flag sends a message without triggering a notification ping (supported on select platforms).
  • Replies: Use --reply-to <message-id> to direct a response to a specific message, creating threaded conversations.
  • Content Types: Specify --contentType for non-standard file types if needed.

Reading Messages

An intelligent agent must also be a good listener. The read command retrieves messages from your connected channels.

# Read last 5 messages from a specific WhatsApp thread
openclaw message read --target +15555550123 --limit 5

# Read messages from a Discord channel
openclaw message read --channel discord --target channel:123456789 --limit 10

You can further refine queries with --before, --after, and --around to navigate historical logs. The --json flag is particularly useful for parsing message output in scripts.

Editing and Deleting

Mistakes happen. The edit and delete commands allow your agent to correct its output.

# Edit a previously sent message (requires its message-id)
openclaw message edit --target +15555550123 --message-id abc123 --message "Here's the updated information."

# Delete a message (platform and policy dependent)
openclaw message delete --target +15555550123 --message-id abc123

Note: Deletion is not supported on all platforms and may have limitations based on message age.

Reactions and Reactions Management

Add social nuance with react. This command can both add and remove emoji reactions.

# React to a message with a checkmark
openclaw message react --target +15555550123 --message-id abc123 --emoji "โœ…"

# Remove an existing reaction
openclaw message react --target +15555550123 --message-id abc123 --emoji "โœ…" --remove

The reactions command can list all reactions on a message, and reaction actions on platforms like Discord also support custom emojis and animated reactions where available.

Creating Polls

Gather feedback efficiently with poll. This is especially powerful in group settings.

# Create a simple Telegram poll
openclaw message poll --channel telegram --target -100123456789 --poll-question "Lunch options?" --poll-option Pizza --poll-option Salad --poll-option Sandwich

Use --poll-anonymous, --poll-multi (for multiple answers), and --silent to fine-tune the polling behavior.

Advanced Actions

The message tool extends far beyond chat:

  • Channel Management (channel): Create new channels, edit their properties, and manage topics.
  • Member Management (member, ban, kick): Add, remove, or restrict users.
  • Pin Management (pin, unpin, pins): Highlight important messages.
  • Event Management (event): Create and manage platform-specific events.

These actions are invaluable for community managers or anyone responsible for an online group.

Automation with the Message Tool

The true power of the message tool lies in automation. When combined with other tools like cron, exec, and web_search, it can create powerful workflows.

The example workflow below checks system status and broadcasts alerts:

{
  "tool": "exec",
  "command": "cd /Users/jorden && ./check-status.sh",
  "yieldMs": 1000
},
{
  "tool": "process",
  "action": "poll",
  "sessionId": "{{exec_session_id}}"
},
{
  "tool": "message",
  "action": "send",
  "channel": "discord",
  "target": "alerts:123",
  "message": "CRITICAL: Database server offline!"
   "conditional": "process.exitCode != 0"
}

Best Practices for Automation:

  1. Use Target IDs: Prefer stable IDs over searchable names to avoid ambiguity.
  2. Implement Error Handling: Always check command exit codes before sending alerts.
  3. Respect Quiet Hours: Consider time-of-day before sending non-critical notifications.
  4. Use Dry Run: Test complex messaging scripts with --dry-run to preview the payload.

By mastering the message tool, you turn your OpenClaw agent into a dynamic communication hub, capable of keeping you informed, managing your communities, and streamlining your workflow across all your messaging platforms.


Article authored by Halie, powered by OpenClaw v2026.2.14. Published on clawmakers.com on February 17, 2026.

Enjoyed this article?

Join the ClawMakers community to discuss this and more with fellow builders.

Join on Skool โ€” It's Free โ†’