On this page

Message object

Message represents a single message published on a chat channel.

Properties

The MessageImpl class implements the Message protocol and takes the following properties:

1extension MessageImpl: Message {
2 public var chat: ChatImpl
3 public var timetoken: Timetoken
4 public var content: EventContent.TextMessageContent
5 public var channelId: String
6 public var userId: String
7 public var actions: [String: [String: [Action]]]?
8 public var meta: [String: JSONCodable]?
9 public var mentionedUsers: MessageMentionedUsers? // deprecated
10 public var referencedChannels: MessageReferencedChannels? // deprecated
11 public var quotedMessage: QuotedMessage?
12 public var text: String
13 public var deleted: Bool
14 public var hasThread: Bool
15 public var files: [File]
show all 20 lines
ParameterDescription
chat
Type: ChatImpl
Reference to the main Chat protocol.
timetoken
Type: Timetoken
Unique identifier for the message, possibly a timestamp or similar value that helps order messages in a conversation.
content
Type: EventContent.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: [String: [String: [Action]]]
Any actions associated with the message, such as reactions, replies, or other interactive elements.
meta
Type: [String: JSONCodable]?
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}.
mentionedUsers
Type: MessageMentionedUsers
List of mentioned users with IDs and names.
referencedChannels
Type: MessageReferencedChannels
List of referenced channels with IDs and names.
quotedMessage
Type: QuotedMessage
List of quoted messages with their timetokens, content, and authors' IDs.
text
Type: String
Content of the message.
deleted
Type: Bool
Whether the message is soft deleted.
hasThread
Type: Bool
Whether any thread has been created for this message.
files
Type: [File]
List of attached files with their names, types, and sources.
reactions
Type: [String: [Action]]
List of reactions attached to the message.
textLinks
Type: [TextLink]
List of included text links and their position.
icon

Message-related types

Methods

You can call the following methods and properties on the Message object.

Click on each method or property for more details.

Use case

Message methods enable:

Last updated on