ThreadMessage object
ThreadMessage represents a single message in a thread.
Properties
The ThreadMessageImpl class extends MessageImpl and implements the ThreadMessage protocol. It takes the following properties:
1extension ThreadMessageImpl: ThreadMessage {
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]]]? // deprecated
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 type: String
show all 23 lines| Parameter | Description |
|---|---|
chatType: ChatImpl | Reference to the main Chat protocol. |
timetokenType: Timetoken | Unique identifier for the message, possibly a timestamp or similar value that helps order messages in a conversation. |
contentType: EventContent.TextMessageContent | Original text content of the message. |
channelIdType: String | Unique identifier for the channel or group in which the message was sent. |
userIdType: String | Unique ID of the user who sent the message. |
actionsType: [String: [String: [Action]]] | |
metaType: [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}. |
mentionedUsersType: MessageMentionedUsers | |
referencedChannelsType: MessageReferencedChannels | |
quotedMessageType: QuotedMessage | List of quoted messages with their timetokens, content, and authors' IDs. |
textType: String | Content of the message. |
deletedType: Bool | Whether the message is soft deleted. |
hasThreadType: Bool | Whether any thread has been created for this message. |
typeType: String | Message type (currently "text" for all thread messages). |
filesType: [File] | List of attached files with their names, types, and sources. |
reactionsType: [MessageReaction] | List of reactions attached to the message. Each MessageReaction contains value, isMine, userIds, and a computed count. |
textLinksType: [TextLink] | |
parentChannelIdType: String | Unique identifier of the main channel on which you create a subchannel (thread channel) and thread messages. |
errorType: Error? | Error associated with the message, if any. |
Methods
You can call the following methods on the ThreadMessage object.
Click on each method for more details.
pinToParentChannel()unpinFromParentChannel()- All methods available under the
Messageobject.
Event listeners
You can call the following event listener methods on the ThreadMessage object.
Click on each method for more details.
streamUpdatesOn()- All event listeners available under the
Messageobject.
Use case
ThreadMessage methods enable: