Readonly
actionThe action type of the message. This can be used to determine if the message was created, updated, or deleted.
Readonly
clientThe clientId of the user who created the message.
Readonly
headersThe headers of a chat message. Headers enable attaching extra info to a message, which can be used for various features such as linking to a relative point in time of a livestream video or flagging this message as important or pinned.
Headers are part of the Ably realtime message extras.headers and they can be used for Filtered Subscriptions and similar.
This value is always set. If there are no headers, this is an empty object.
Do not use the headers for authoritative information. There is no server-side validation. When reading the headers, treat them like user input.
Readonly
metadataThe metadata of a chat message. Allows for attaching extra info to a message, which can be used for various features such as animations, effects, or simply to link it to other resources such as images, relative points in time, etc.
Metadata is part of the Ably Pub/sub message content and is not read by Ably.
This value is always set. If there is no metadata, this is an empty object.
Do not use metadata for authoritative information. There is no server-side validation. When reading the metadata treat it like user input.
Readonly
reactionsThe reactions summary for this message.
Readonly
serialThe unique identifier of the message.
Readonly
textThe text of the message.
Readonly
timestampThe timestamp at which the message was created.
Readonly
versionInformation about the latest version of this message.
Creates a copy of the message with fields replaced per the parameters.
Optional
params: MessageCopyParamsThe parameters to replace in the message.
The message copy.
Creates a new message instance with the event applied.
NOTE: This method will not replace the message reactions if the event is of type Message
.
The event to be applied to the returned message.
A new message instance with the event applied. If the event is a no-op, such as an event for an old version, the same message is returned (not a copy).
ErrorInfo if the event is for a different message.
ErrorInfo if the event is a ChatMessageEventType.Created.
Represents a single message in a chat room.