ThreadMessage object

ThreadMessage is an object that refers to a single message in a thread.

Properties

The ThreadMessageImpl class extends MessageImpl and implements the ThreadMessage protocol. It takes the following properties:

extension ThreadMessageImpl: ThreadMessage {
public var chat: ChatImpl
public var timetoken: Timetoken
public var content: EventContent.TextMessageContent
public var channelId: String
public var userId: String
public var actions: [String: [String: [Action]]]?
public var meta: [String: JSONCodable]?
public var mentionedUsers: MessageMentionedUsers?
public var referencedChannels: MessageReferencedChannels?
public var quotedMessage: QuotedMessage?
public var text: String
public var deleted: Bool
public var hasThread: Bool
public var type: String
show all 22 lines
ParameterTypeDescription
chatChatImplReference to the main Chat protocol.
timetokenTimetokenUnique identifier for the message, possibly a timestamp or similar value that helps order messages in a conversation.
contentEventContent.TextMessageContentOriginal text content of the message.
channelIdStringUnique identifier for the channel or group in which the message was sent.
userIdStringUnique ID of the user who sent the message.
actions[String: [String: [Action]]]Any actions associated with the message, such as reactions, replies, or other interactive elements.
meta[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}.
mentionedUsersMessageMentionedUsersList of mentioned users with IDs and names.
referencedChannelsMessageReferencedChannelsList of referenced channels with IDs and names.
quotedMessageQuotedMessageList of quoted messages with their timetokens, content, and authors' IDs.
textStringContent of the message.
deletedBoolWhether the message is soft deleted.
hasThreadBoolWhether any thread has been created for this message.
files[File]List of attached files with their names, types, and sources.
reactions[String: [Action]]List of reactions attached to the message.
textLinks[TextLink]List of included text links and their position.
parentChannelIdStringUnique identifier of the main channel on which you create a subchannel (thread channel) and thread messages.

Methods

You can call the following methods on the ThreadMessage object.

Click on each method for more details.

Use case

For example, you can use the ThreadMessage-related methods to:

  • Let users send messages in threads.
  • Pin them to the channel when needed.
Last updated on