Message object
Message is an object that refers to a single message published on a chat channel.
Properties
The Message interface has the following properties:
1interface Message {
2 val chat: Chat
3 val timetoken: Long
4 val content: EventContent.TextMessageContent
5 val channelId: String
6 val userId: String
7 val actions: Map<String, Map<String, List<Action>>>?
8 val meta: Map<String, Any>?
9 val mentionedUsers: MessageMentionedUsers? // deprecated
10 val referencedChannels: MessageReferencedChannels? // deprecated
11 val quotedMessage: QuotedMessage?
12 val text: String
13 val deleted: Boolean
14 val hasThread: Boolean
15 val files: List<File>
show all 20 lines| Parameter | Description |
|---|---|
chatType: Chat | Reference to the main Chat object. |
timetokenType: Long | 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: Map<String, Map<String, List<Action>>> | Any actions associated with the message, such as reactions, replies, or other interactive elements. |
metaType: Map<String, Any> | 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: Boolean | Whether the message is soft deleted. |
hasThreadType: Boolean | Whether any thread has been created for this message. |
filesType: List<File> | List of attached files with their names, types, and sources. |
reactionsType: Map<String, List<Action>> | List of reactions attached to the message. |
textLinksType: List<TextLink> |
Methods
You can call the following methods and properties on the Message object.
Click on each method or property for more details.
createThread()createThreadMessageDraft()delete()deletedhasThreadeditText()forward()getThread()hasUserReaction()toggleReaction()pin()quotedMessagereactionsremoveThread()report()restore()streamUpdates()streamUpdatesOn()texttextlinks
Use case
For example, you can use the Message object methods to: