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


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