Rate this page:

Message

Describes single message. Received via the MessengerEvents.SendMessageor MessengerEvents.EditMessageevents and used to serialize or edit the message.

Props

conversation

Copy URL
conversation: 

string

The UUID of the conversation this message belongs to.

payload

Copy URL
payload: 

any[]

Array of payload objects associated with the message. Setting this property does not send changes to the cloud. Use the Message.updatemethod to send all the changes at once.

sender

Copy URL
sender: 

number

The id of the user who sent this message (see ConversationParticipant.userId.

text

Copy URL
text: 

string

Message text. Setting this property does not send changes to the cloud. Use the Message.updatemethod to send all the changes at once.

uuid

Copy URL
uuid: 

string

The universally unique identifier (UUID) of the message. Can be used on client side for housekeeping.

Methods

remove

Copy URL
remove(): 

Promise<RemoveMessageEvent>

Remove the message from the conversation. Triggers the MessengerEvents.RemoveMessageevent for all parties of the conversation (online participants and logged in clients). To get the result, use one of these options:

Returns

toCache

Copy URL
toCache(): 

SerializedMessage

Serialize the message so it can be stored (e.g. in IndexedDB) and later restored via the [Messenger2.createMessageFromCache] method

Returns

update

Copy URL
update(): 

Promise<EditMessageEvent>

Send text and payload changes to the cloud. Triggers the MessengerEvents.EditMessageevent for all parties of the conversation (online participants and logged in clients). To get the result, use one of these options:

Returns