Skip to main content
This page documents the message classes used across all CometChat SDKs. All message objects share the same structure regardless of platform. All properties are accessed via getter methods.

Class Hierarchy


BaseMessage

BaseMessage is the base class for all message types. Every message object — whether it’s a text message, media message, or custom message — extends this class.

Properties

Conditional Properties

These properties may or may not be populated depending on the method or request configuration used to fetch the message.

TextMessage

TextMessage extends BaseMessage and represents a text-based chat message. It inherits all properties from BaseMessage and adds the following.

Properties

Conditional Properties

These properties may or may not be populated depending on the method or request configuration used to fetch the message.

MediaMessage

MediaMessage extends BaseMessage and represents a message with media attachments such as images, videos, audio files, or documents. It inherits all properties from BaseMessage and adds the following.

Properties

Conditional Properties

These properties may or may not be populated depending on the method or request configuration used to fetch the message.

CustomMessage

CustomMessage extends BaseMessage and represents a developer-defined message with a custom data payload. It inherits all properties from BaseMessage and adds the following.

Properties

Conditional Properties

These properties may or may not be populated depending on the method or request configuration used to fetch the message.

Action

Action extends BaseMessage and represents a system-generated action message such as a member joining, leaving, or being banned from a group. It inherits all properties from BaseMessage and adds the following.

Properties


Call

Call extends BaseMessage and represents a voice or video call message. It inherits all properties from BaseMessage and adds the following.

Properties


AIAssistantMessage

AIAssistantMessage extends BaseMessage and represents the full assistant reply persisted after an AI Agent run completes. It is received via the onAIAssistantMessageReceived callback of the MessageListener. It inherits all properties from BaseMessage and adds the following.

Properties

AIAssistantMessageData


AIAssistantElement

AIAssistantElement is a single ordered content block returned by AIAssistantMessage.getElements(). Each element is a { type, value } envelope; the SDK returns the value raw and never interprets it — branch on getType() to decide how to read getData().

CardMessage

CardMessage extends BaseMessage and represents a standalone card message (category card). It is received via the onCardMessageReceived callback of the MessageListener. The SDK returns the card payload raw; your app renders it. See the Card Messages guide. It inherits all properties from BaseMessage and adds the following.

Properties


AIToolResultMessage

AIToolResultMessage extends BaseMessage and represents the output of a tool call made during an AI Agent run. It is received via the onAIToolResultReceived callback of the MessageListener. It inherits all properties from BaseMessage and adds the following.

Properties

AIToolResultMessageData


AIToolArgumentMessage

AIToolArgumentMessage extends BaseMessage and represents the arguments passed to a tool during an AI Agent run. It is received via the onAIToolArgumentsReceived callback of the MessageListener. It inherits all properties from BaseMessage and adds the following.

Properties

AIToolArgumentMessageData

AIToolCall

AIToolCallFunction


AIAssistantBaseEvent

AIAssistantBaseEvent is the base class for all real-time streaming events from an AI Agent run. It is received via the onAIAssistantEventReceived callback of the AIAssistantListener. The type field identifies the specific event (e.g., "run_started", "tool_call_started", "text_message_content", "run_finished").

Properties


AIAssistantCardStartedEvent

AIAssistantCardStartedEvent extends AIAssistantBaseEvent and is emitted (event type card_start) when an AI Agent begins generating a card during a streaming run. See the Card Messages guide. It inherits all properties from AIAssistantBaseEvent and adds the following.

Properties


AIAssistantCardReceivedEvent

AIAssistantCardReceivedEvent extends AIAssistantBaseEvent and is emitted (event type card) when the full card payload is delivered during a streaming run. It inherits all properties from AIAssistantBaseEvent and adds the following.

Properties


AIAssistantCardEndedEvent

AIAssistantCardEndedEvent extends AIAssistantBaseEvent and is emitted (event type card_end) when card generation finishes during a streaming run. It inherits all properties from AIAssistantBaseEvent and adds the following.

Properties