Skip to main content

Overview

Message options control how messages are sent and displayed. These options are passed as the third parameter to sendMessage:

Quoted Messages

Reply to a specific message:
Quoted messages work with all message types - text, media, locations, contacts, etc.

Quote Any Message Type

Ephemeral Messages

Send disappearing messages that auto-delete after a specified time:

Supported Durations

Enable Disappearing Messages in Chat

Turn on disappearing messages for all future messages in a chat:

Custom Message ID

Override the auto-generated message ID:
Custom message IDs must follow WhatsApp’s format. Use generateMessageIDV2() to ensure compatibility.

Custom Timestamp

Set a custom timestamp for the message:
WhatsApp may reject messages with timestamps too far in the past or future.

Broadcast Messages

Send to multiple recipients or as a status:

Status/Story Broadcast

Message Options for Broadcasts

Media Upload Options

Control media upload behavior:

Cached Group Metadata

Control whether to use cached group metadata:
By default, Baileys uses cached group metadata to improve performance. Set to false to always fetch fresh data.

All Message Options

Here’s the complete type definition from the source:

Combining Options

You can combine multiple options:

Message Context Info

Add context info directly in the message content:
While you can set context info manually, using the quoted option and mentions array is recommended as Baileys handles the context info automatically.

Special Message Options

Forward Message

View Once

viewOnce is part of the message content, not options.

Best Practices

  1. Ephemeral Messages: Use standard durations (24h, 7d, 90d) for compatibility
  2. Message IDs: Only use custom IDs when necessary; let Baileys generate them
  3. Timestamps: Avoid setting custom timestamps unless required
  4. Media Timeouts: Increase timeout for large files or slow connections
  5. Group Metadata: Use cached metadata for better performance
  6. Broadcast Lists: Ensure all JIDs in statusJidList are valid

Examples from Source

Troubleshooting

Quoted Message Not Showing

Ensure the quoted message object is complete:

Ephemeral Not Working

Check that:
  1. The duration is in seconds (not milliseconds)
  2. You’re using a supported duration (24h, 7d, 90d)
  3. The chat supports ephemeral messages

Broadcast Not Delivering

Verify:
  1. broadcast: true is set in options
  2. statusJidList contains valid JIDs
  3. JID format is correct (@s.whatsapp.net)

Next Steps

Modifying Messages

Learn to edit and delete messages

Text Messages

Back to text message basics