Message
Methods
remove
remove(): Promise<MessengerEventTypes.RemoveMessage,MessengerEventTypes.Error>
Remove the message from the conversation.The participant that calls this method should have:
- the ConversationParticipant.canRemoveMessagespermission 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
type:
Promise<MessengerEventTypes.RemoveMessage,MessengerEventTypes.Error>
update
update(text: string
, payload: {[key: string]: any}[]
): Promise<MessengerEventTypes.EditMessage,MessengerEventTypes.Error>
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:
string
New text of this message, maximum 5000 characters. If null, message text will not be updated.
payload:
{[key: string]: any}[]
New payload of this message. If null, message payload will not be updated.
Returns
type:
Promise<MessengerEventTypes.EditMessage,MessengerEventTypes.Error>
Props
conversation
conversation: string
The UUID of the conversation this message belongs to. The message can belong to the one conversation only.
payload
payload: {[key: string]: any}[]
The array of payload objects associated with the message.
sequence
sequence: number
The message sequence number in the conversation.
text
text: string
The text of this message.
uuid
uuid: string
The universally unique identifier (UUID) of the message.