Message object

Message is an object that refers to a single message published on a chat channel.

Properties

The Message object has the following properties:

class Message {
timetoken: string,
content: TextMessageContent,
channelId: string,
userId: string,
actions?: MessageActions,
meta?: {
[key: string]: any
},
error?: string
}
ParameterDescription
timetoken
Type: string
Unique identifier for the message, possibly a timestamp or similar value that helps order messages in a conversation.
content
Type: TextMessageContent
Original text content of the message.
channelId
Type: string
Unique identifier for the channel or group in which the message was sent.
userId
Type: string
Unique ID of the user who sent the message.
actions
Type: MessageActions or undefined
Any actions associated with the message, such as reactions, replies, or other interactive elements.
meta
Type: object or undefined
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
Type: string or undefined
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.
icon

Message-related types

Methods

You can call the following methods on the Message object.

Click on each method for more details.

Use case

For example, you can use the Message object methods to:

Last updated on