Skip to main content

Interface: Message

api/model/message.Message

Properties

ack

ack: MessageAck

The acknolwedgement state of a message MessageAck


author

author: string


body

body: string

The body of the message. If the message type is chat , body will be the text of the chat. If the message type is some sort of media, then this body will be the thumbnail of the media.


broadcast

broadcast: boolean

If the message is sent as a broadcast


buttons

Optional buttons: Button[]

Buttons associated with the message


caption

caption: string

If the message is of a media type, it may also have a caption


chat

chat: Chat

The chat object


chatId

chatId: ChatId


clientUrl

clientUrl: string

Deprecated

Ironically, you should be using deprecatedMms3Url instead


cloudUrl

Optional cloudUrl: string

The URL of the file after being uploaded to the cloud using a cloud upload message preprocessor.


content

content: string


deprecatedMms3Url

deprecatedMms3Url: string


duration

Optional duration: string | number

The length of the media in the message, if it exists.


filePath

Optional filePath: string

When config.messagePreprocessor: "AUTO_DECRYPT_SAVE" is set, media is decrypted and saved on disk in a folder called media relative to the current working directory.

This is the filePath of the decrypted file.


filehash

Optional filehash: string

Used to checking the integrity of the decrypted media.


filename

Optional filename: string

The given filename of the file


from

from: ChatId

The chat from which the message was sent


fromMe

fromMe: boolean

If the message is from the host account


id

id: MessageId

The id of the message. Consists of the Chat ID and a unique string.

Example:

false_447123456789@c.us_7D914FEA78BE10277743F4B785045C37

invis

invis: boolean


isAnimated

isAnimated: boolean


isForwarded

isForwarded: boolean

If the message has been forwarded


isGroupMsg

isGroupMsg: boolean


isMMS

isMMS: boolean


isMedia

isMedia: boolean


isNewMsg

isNewMsg: boolean


isNotification

isNotification: boolean


isPSA

isPSA: boolean


isViewOnce

isViewOnce: boolean

Is the message a "view once" message


labels

labels: string[]

The labels associated with the message (used with business accounts)


lat

Optional lat: string

The latitude of a location message


list

Optional list: Object

The list associated with the list message

Type declaration

NameType
buttonTextstring
descriptionstring
sectionsSection[]
titlestring

listResponse

Optional listResponse: Row

List response associated with the message


lng

Optional lng: string

The longitude of a location message


loc

Optional loc: string

The text associated with a location message


mId

mId: string

The unique segment of the message id.

Example:

7D914FEA78BE10277743F4B785045C37

mediaData

mediaData: unknown


mentionedJidList

mentionedJidList: ContactId[]

An array of all mentioned numbers in this message.


mimetype

Optional mimetype: string


notifyName

notifyName: string


quoteMap

quoteMap: QuoteMap

Use this to traverse the quote chain.


quotedMsg

Optional quotedMsg: Message


quotedMsgObj

Optional quotedMsgObj: Message


recvFresh

recvFresh: boolean


selectedButtonId

selectedButtonId: string

The ID of the selected button


self

self: "in" | "out"

Indicates whether the message was sent by the host account


sender

sender: Contact

The contact object of the account that sent the message


shareDuration

shareDuration: number


star

star: boolean


stickerAuthor

Optional stickerAuthor: string


stickerPack

Optional stickerPack: string


t

t: number

The timestamp of the message


text

text: string

a convenient way to get the main text content from a message.


timestamp

timestamp: number

the timestanmp of the message


to

to: ChatId

The chat id to which the message is being sent


type

type: MessageTypes

The type of the message, see MessageTypes