For AI agents: this page in Markdown: https://www.pubnub.com/docs/chat/chat-sdk/learn/chat-entities/message.md. Documentation index: https://www.pubnub.com/llms-full.txt.
Message object
Message represents a single message published on a chat channel.
Properties
Message has the following properties:
1class Message {
2 timetoken: string,
3 content: TextMessageContent,
4 channelId: string,
5 userId: string,
6 actions?: MessageActions,
7 reactions?: MessageReaction[],
8 meta?: {
9 [key: string]: any
10 },
11 error?: string
12}
timetoken#- Unique identifier for the message, possibly a timestamp or similar value that helps order messages in a conversation.
content#- Original text content of the message.
channelId#- Unique identifier for the channel or group in which the message was sent.
Deprecated#actions- Deprecated. Any actions associated with the message, such as reactions, replies, or other interactive elements.
reactions#- List of reactions. Each
MessageReactionhasvalue(emoji string),isMine(boolean), anduserIds(string array). meta#- Extra information added to the message giving additional context. This object can be of any type and can consist of a list of key-value pairs. For example,
{language: 'English', wordCount: 42}. error#- Error added to the message when either the message or files it contains couldn't be decrypted. For more information, refer to the Data security section.
Methods
Available methods:
Regular methods
createThread()createThreadWithResult()createThreadMessageDraft()delete()- (getter)
deleted - (getter)
hasThread editText()forward()getMessageElements()getThread()hasUserReaction()toggleReaction()pin()- (getter)
quotedMessage - (getter)
reactions removeThread()report()restore()- (getter)
text
Event listeners
onUpdated()(deprecated)streamUpdates()- (static)
streamUpdatesOn()
Use case
Message methods enable: