Message
Interface representing a message within a conversation.
Methods
edit
edit(options: ): Promise<ConversationMessageEventPayload>
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
null
orundefined
The 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
remove(): Promise<ConversationMessageEventPayload>
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
conversation: string
The UUID of the conversation where the message has been posted.
sequence
sequence: number
Message sequence number in the conversation.
text
text: string
The message text.
uuid
uuid: string
The universally unique identifier (UUID) of the message.