Message

sealed class Message

Represents all information about a message in chat. Messages can be either systemic or user generated. There shouldn't be a distinction on the client side about those messages, though you should know they are created in different ways.

As long as you receive this object from whatever source, you have a guarantee that this object exists somewhere on the server. Messages are never generated locally as phantoms.

See also

Inheritors

Types

Link copied to clipboard
abstract class ListPicker : Message

A list picker displays a list of items, and information about the items, such as product name, description, and image, in the Messages app on the customer's device. The customer can interact multiple times with one or more items from the list. Each interaction should send a reply (on behalf of the user) together with the postback value.

Link copied to clipboard
abstract class Plugin : Message

Rich content messages, called plugins. These are very often generated by Agent action in the agent console. Your application can support all PluginElement or just focus on the components that is currently required by your own specification. Note that new elements can be added to the backend services for which you need to update the SDK. New elements, previously undefined are ignored by the SDK until implemented.

Link copied to clipboard
abstract class QuickReplies : Message

Quick Reply messages have a title to present to the user along with a selection of quick response Action.ReplyButton. The buttons should also be presented to the user, and if the user taps a button, the associated postback should be sent together with the text of the button as a reply message (on behalf of the user). The action can be invoked only once, and the integrating applications have to prevent multiple uses.

Link copied to clipboard
abstract class RichLink : Message

A RichLink message to display.

Link copied to clipboard
abstract class Text : Message

Simple message representing only text content. This type of content is usually generated through User or Agent replying to each other.

Properties

Link copied to clipboard

Attachments provided with the message. This field can be empty. It contains attachments that the user or agent sent alongside with the message.

Link copied to clipboard
abstract val author: MessageAuthor?

Author associated with this message.

Link copied to clipboard
abstract val createdAt: Date

The timestamp of when the message was created on the server. Similarly to id this field shouldn't change for the lifetime of the message.

Link copied to clipboard

The direction in which the message is sent.

Link copied to clipboard
abstract val fallbackText: String?

Optional fallback text which can be used if UI integration doesn't support concrete subtype of Message.

Link copied to clipboard
abstract val id: UUID

The id that was assigned to this message. If another message has matching id, it's the same message with possibly different content.

Link copied to clipboard

The otherwise uncategorizable properties for this message. It can contain anything from message status to custom properties.

Link copied to clipboard
abstract val threadId: UUID

The thread id that this message belongs to. Messages should never be mismatched between threads as this can lead to inconsistencies and undefined behavior.