Overview
Message options control how messages are sent and displayed. These options are passed as the third parameter tosendMessage:
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 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
- Ephemeral Messages: Use standard durations (24h, 7d, 90d) for compatibility
- Message IDs: Only use custom IDs when necessary; let Baileys generate them
- Timestamps: Avoid setting custom timestamps unless required
- Media Timeouts: Increase timeout for large files or slow connections
- Group Metadata: Use cached metadata for better performance
- Broadcast Lists: Ensure all JIDs in
statusJidListare valid
Examples from Source
Troubleshooting
Quoted Message Not Showing
Ensure the quoted message object is complete:Ephemeral Not Working
Check that:- The duration is in seconds (not milliseconds)
- You’re using a supported duration (24h, 7d, 90d)
- The chat supports ephemeral messages
Broadcast Not Delivering
Verify:broadcast: trueis set in optionsstatusJidListcontains valid JIDs- JID format is correct (
@s.whatsapp.net)
Next Steps
Modifying Messages
Learn to edit and delete messages
Text Messages
Back to text message basics