Basic Text Message
Send a simple text message using thesendMessage method:
jid is the WhatsApp ID of the recipient. See WhatsApp IDs for more information.
Mentioning Users
You can mention users in text messages by including their JID in thementions array:
The
@number in the text is optional for display purposes. The mentions array is what triggers the actual mention.Text with Context Info
Add additional context to your messages usingcontextInfo:
Message Options
Thetext content type is defined in AnyMessageContent:
Available Options
mentions: Array of JIDs to mentioncontextInfo: Additional message context (seeproto.IContextInfo)edit: Message key to edit an existing messagelinkPreview: Custom link preview (see Link Previews)
Editing Text Messages
Edit a previously sent text message:Common Patterns
Send and Quote
See Forwarding & Quoting for how to quote messages.Send with Link Preview
See Link Previews for automatic link preview generation.Disappearing Messages
Send text with a disappearing timer:Type Reference
Fromsrc/Types/Message.ts:218-224:
Mentionable={ mentions?: string[] }Contextable={ contextInfo?: proto.IContextInfo }Editable={ edit?: WAMessageKey }