Message
Interface representing a message within a conversation.
Methods
edit
Promise<ConversationMessageEventPayload>
edit( options)Sends text and payload changes to the cloud.
Triggers the MessengerEventType.onEditMessage event for all participants in the conversation (online users and logged-in clients).
Throws a MessengerError if:
Both MessageEditOptions.text and MessageEditOptions.payload are
nullorundefinedThe current does not have permissions to edit their own messages (see ConversationParticipant.canEditMessages)
The current does not have permissions to edit messages from other participants (see ConversationParticipant.canEditAllMessages and ConversationParticipant.isOwner)
Returns a promise that resolves with a ConversationMessageEventPayload object.
Parameters
options:
The new text and/or payload for the message.
Returns
type:
Promise<ConversationMessageEventPayload>
Throws
remove
Promise<ConversationMessageEventPayload>
remove()Deletes the message in the conversation.
Triggers the MessengerEventType.onRemoveMessage event for all participants in the conversation (online users and logged-in clients).
Throws a MessengerError if:
- The current does not have permissions to delete their own messages (see ConversationParticipant.canRemoveMessages)
- The current does not have permissions to delete messages of other participants (see ConversationParticipant.canRemoveAllMessages and ConversationParticipant.isOwner)
Returns a promise that resolves with a ConversationMessageEventPayload object.
Returns
type:
Promise<ConversationMessageEventPayload>
Throws
Props
conversation
conversationThe UUID of the conversation where the message has been posted.
payload
payloadArray of payload objects associated with the message.
sequence
sequenceMessage sequence number in the conversation.
text
textThe message text.
uuid
uuidThe universally unique identifier (UUID) of the message.