docs/Message.html
ackauthorbodybroadcastdeviceTypedurationforwardingScorefromfromMegroupMentionshasMedia
hasQuotedMsghasReactionidinviteV4isEphemeralisForwardedisGifisStarredisStatuslinkslocation
mediaKeymentionedIdsorderIdrawDatatimestamptotokentypevCards
acceptGroupV4Invite()delete(everyone[, clearMedia])downloadMedia()edit(content[, options])editScheduledEvent(editedEventObject)forward(chat)getChat()getContact()
getGroupMentions()getInfo()getMentions()getOrder()getPayment()getPollVotes()getQuotedMessage()getReactions()
pin(duration)react(reaction)reload()reply(content[, chatId][, options])star()unpin()unstar()vote(selectedOptions)
ExtendsBase
ACK status for the message
If the message was sent to a group, this field will contain the user that sent the message.
Message content
Indicates if the message was a broadcast
String that represents from which device type the message was sent
Indicates the duration of the message in seconds
Indicates how many times the message was forwarded.
The maximum value is 127.
ID for the Chat that this message was sent to, except if the message was sent by the current user.
Indicates if the message was sent by the current user
Indicates whether there are group mentions in the message body
Indicates if the message has media available for download
Indicates if the message was sent as a reply to another message.
Indicates whether there are reactions to the message
ID that represents the message
Group Invite Data
Indicates if the message will disappear after it expires
Indicates if the message was forwarded
Indicates whether the message is a Gif
Indicates if the message was starred
Indicates if the message is a status update
Links included in the message.
Location information contained in the message, if the message is type "location"
MediaKey that represents the sticker 'ID'
Indicates the mentions in the message body.
Order ID for message type ORDER
Returns message in a raw format
Unix timestamp for when the message was created
ID for who this message is for.
If the message is sent by the current user, it will be the Chat to which the message is being sent. If the message is sent by another user, it will be the ID for the current user.
Order Token for message type ORDER
Message type
List of vCards contained in the message.
async
Accept Group V4 Invite
Returns
Promise containing Object
async
Deletes a message from the chat
| Name | Type | Optional | Description |
|---|---|---|---|
everyone
|
boolean
|
|
If true and the message is sent by the current user or the user is an admin, will delete it for everyone in the chat.
Value can be null.
| |
clearMedia
|
boolean
|
Yes
|
If true, any associated media will also be deleted from a device.
Value can be null. Defaults to true.
|
async
Downloads and returns the attatched message media
Returns
Promise containing MessageMedia
async
Edits the current message.
| Name | Type | Optional | Description |
|---|---|---|---|
content
|
string
|
| | |
options
|
MessageEditOptions
|
Yes
|
Options used when editing the message
|
Returns
Promise containing nullable Message
async
Edits the current ScheduledEvent message. Once the scheduled event is canceled, it can not be edited.
| Name | Type | Optional | Description |
|---|---|---|---|
editedEventObject
|
|
| |
Returns
Promise containing nullable Message
async
Forwards this message to another chat (that you chatted before, otherwise it will fail)
| Name | Type | Optional | Description |
|---|---|---|---|
chat
|
(string or Chat)
|
|
Chat model or chat ID to which the message will be forwarded
|
Returns
Promise
Returns the Chat this message was sent in
Returns
Promise containing Chat
Returns the Contact this message was sent from
Returns
Promise containing Contact
async
Returns groups mentioned in this message
Returns
Promise containing Array of GroupChat
async
Get information about message delivery status. May return null if the message does not exist or is not sent by you.
Returns
Promise containing nullable MessageInfo
async
Returns the Contacts mentioned in this message
Returns
Promise containing Array of Contact
async
Gets the order associated with a given message
Returns
Promise containing Order
async
Gets the payment details associated with a given message
Returns
Promise containing Payment
async
Returns the PollVote this poll message
Returns
Promise containing Array of PollVote
async
Returns the quoted message, if any
Returns
Promise containing Message
async
Gets the reactions associated with the given message
Returns
Promise containing Array of ReactionList
async
Pins the message (group admins can pin messages of all group members)
| Name | Type | Optional | Description |
|---|---|---|---|
duration
|
number
|
|
The duration in seconds the message will be pinned in a chat
|
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
async
React to this message with an emoji
| Name | Type | Optional | Description |
|---|---|---|---|
reaction
|
string
|
|
Emoji to react with. Send an empty string to remove the reaction.
|
Returns
Promise
async
Reloads this Message object's data in-place with the latest values from WhatsApp Web. Note that the Message must still be in the web app cache for this to work, otherwise will return null.
Returns
Promise containing Message
async
Sends a message as a reply to this message. If chatId is specified, it will be sent through the specified Chat. If not, it will send the message in the same Chat as the original message was sent.
| Name | Type | Optional | Description |
|---|---|---|---|
content
|
(string, MessageMedia, or Location)
|
| | |
chatId
|
string
|
Yes
| | |
options
|
|
Yes
| |
Returns
Promise containing Message
async
Stars this message
async
Unpins the message (group admins can unpin messages of all group members)
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
async
Unstars this message
async
Send votes to the poll message
| Name | Type | Optional | Description |
|---|---|---|---|
selectedOptions
|
Array of string
|
|
Array of options selected.
|
Returns
Promise