AnyMessageContent
Union type representing all possible message content types that can be sent.AnyRegularMessageContent
Union type for standard message content types.Text Messages
TextMessageContent
Send text messages with optional mentions, link previews, and context.The text content of the message
Optional link preview information for URLs in the text
List of JIDs that are mentioned in the text (e.g.,
['[email protected]'])Additional context information (quoted messages, forwarding info, etc.)
Message key of the message to edit (for editing existing messages)
Media Messages
AnyMediaMessageContent
Union type for all media message types.ImageMessageContent
Send image messages with optional captions and dimensions.The image file as Buffer, stream, or URL
Optional caption for the image
JPEG thumbnail as base64 string
Image width in pixels
Image height in pixels
List of mentioned JIDs in the caption
Additional context information
MIME type of the image (e.g., ‘image/jpeg’, ‘image/png’)
VideoMessageContent
Send video messages with optional captions, GIF playback, and PTV support.The video file as Buffer, stream, or URL
Optional caption for the video
If true, plays the video as a looping GIF
JPEG thumbnail as base64 string
If set to true, will send as a video note (round video message)
Video width in pixels
Video height in pixels
List of mentioned JIDs in the caption
Additional context information
MIME type of the video (e.g., ‘video/mp4’)
AudioMessageContent
Send audio messages or voice notes.The audio file as Buffer, stream, or URL
If set to true, will send as a voice note (push-to-talk)
Optional duration of the audio in seconds
MIME type of the audio (e.g., ‘audio/ogg; codecs=opus’, ‘audio/mp4’)
StickerMessageContent
Send sticker messages with optional animation.The sticker file as Buffer, stream, or URL (WebP format)
If true, the sticker is animated
Sticker width in pixels
Sticker height in pixels
MIME type (usually ‘image/webp’)
DocumentMessageContent
Send document files with specified MIME type.The document file as Buffer, stream, or URL
MIME type of the document (e.g., ‘application/pdf’, ‘application/vnd.openxmlformats-officedocument.wordprocessingml.document’)
Optional filename to display
Optional caption for the document
Additional context information
Interactive Messages
PollMessageContent
Create poll messages with multiple selectable options.Poll configuration object
The poll question
Array of poll options
Number of options users can select (default: 1)
32-byte message secret to encrypt poll selections
Whether the poll is sent to an announcement group
List of mentioned JIDs
Additional context information
EventMessageContent
Create event messages for scheduling meetings and calls.Event configuration object
Event name/title
Event start date and time
Optional event description
Optional event end date and time
Optional event location
Type of call associated with the event
Whether the event is cancelled
Whether this is a scheduled call
Whether extra guests are allowed
Message secret for encryption
ReactionMessage
React to messages with emojis.Reaction message object
Key of the message to react to
Emoji to react with (empty string to remove reaction)
Contact & Location Messages
ContactsMessageContent
Share contact information.Contacts object containing display name and contact array
Optional display name for the contacts
Array of contact messages
LocationMessageContent
Share location information.Location message object
Latitude coordinate
Longitude coordinate
Optional location name
Optional location address
Business Messages
ProductMessageContent
Send product catalog messages.Product information object
JID of the business owner
Optional message body text
Optional footer text
Reply & Interaction Messages
ButtonReplyMessageContent
Reply to button messages.Button reply information
Display text of the button
Button ID
Button index
Type of button reply
ListReplyMessageContent
Reply to list messages.List reply message object (without contextInfo)
GroupInviteMessageContent
Send group invitation messages.Group invitation information
Group invite code
Invite expiration timestamp
Invitation text
Group JID
Group subject/name
Message Actions
ForwardMessage
Forward existing messages.The message to forward
Force forwarding even if message is not forwardable
DeleteMessage
Delete messages (your own or anyone’s in a group if you’re an admin).Message key of the message to delete
PinMessage
Pin messages in a chat.Message key of the message to pin
Pin type (PIN_IN_CHAT or UNPIN_IN_CHAT)
Pin duration: 86400 (24 hours), 604800 (7 days), or 2592000 (30 days)
DisappearingMessagesToggle
Toggle disappearing messages in a chat.false to disable, or a number (in seconds) to enable with expiration timeLimitSharingToggle
Limit message forwarding and sharing.Whether to limit sharing of messages
Privacy & Sharing
SharePhoneNumber
Share your phone number.Whether to share phone number
RequestPhoneNumber
Request phone number from recipient.Whether to request phone number
Helper Types
ViewOnce
Make any message viewable only once.If true, the message will be viewable only once