ВОЙТИ

Message

Describes single message. Received via the MessengerEvents.SendMessage or MessengerEvents.EditMessage events and used to serialize or edit the message.

Methods

remove

remove(): Promise<RemoveMessageEvent>

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

Returns

toCache

toCache(): SerializedMessage

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

Returns

update

update(): Promise<EditMessageEvent>

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

Returns

Properties

conversation

conversation: string

The UUID of the conversation this message belongs to.

payload

payload: Array<Object>

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

sender

sender: number

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

text

text: string

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

uuid

uuid: string

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