Message
Interface that represents a message within a conversation.
Methods
remove
remove(): Promise<MessageEvent|ErrorEvent>
Remove the message from the conversation.
The participant that calls this method should have:
- the ConversationParticipant.canRemoveMessages permission to remove its own messages
- the ConversationParticipant.canRemoveAllMessages permission to remove other participants' messages
Other parties of the conversation (online participants and logged in clients) can be informed about the message removing via the MessengerEventTypes.RemoveMessage event.
Returns
Return:
Promise<MessageEvent|ErrorEvent>
update
update(text: string, payload: Array<object>): Promise<MessageEvent|ErrorEvent>
Send text and payload changes to the cloud.
The participant that calls this method should have:
- the ConversationParticipant.canEditMessages permission to update its own messages
- the ConversationParticipant.canEditAllMessages permission to update other participants' messages
Other parties of the conversation (online participants and logged in clients) can be informed about the message updating via the MessengerEventTypes.EditMessage event.
To be informed about the message updating while being offline, participants can subscribe to the MessengerNotification.EditMessage messenger push notification.
Parameters
text:
stringNew text of this message, maximum 5000 characters. If null, message text will not be updated.
payload:
Array<object>New payload of this message. If null, message payload will not be updated.
Returns
Return:
Promise<MessageEvent|ErrorEvent>
Properties
conversation
The UUID of the conversation this message belongs to. The message can belong to the one conversation only.
payload
The array of payload objects associated with the message.
sequence
The message sequence number in the conversation.
text
The text of this message.
uuid
The universally unique identifier (UUID) of the message.