Skip to main content
Message Categories:
  • Message: text, image, video, audio, file
  • Custom: Developer-defined types (e.g., location)
  • Interactive: form, card, customInteractive
  • Action: groupMember, message (system-generated)
  • Call: audio, video (with status: initiated, ongoing, ended, etc.)
Check message type:
Every message in CometChat belongs to a category and has a specific type within that category. Understanding this hierarchy helps you handle different message types correctly.

Message Hierarchy

Categories Overview

CategoryTypesDescription
messagetext, image, video, audio, fileStandard user messages
customDeveloper-definedCustom data (location, polls, etc.)
interactiveform, card, customInteractiveMessages with actionable UI elements
actiongroupMember, messageSystem-generated events
callaudio, videoCall-related messages

Checking Message Category and Type

Use getCategory() and getType() on a BaseMessage to determine how to handle a received message:

Message

Standard user messages. Types: text, image, video, audio, file.

Custom

Developer-defined messages for content that doesn’t fit standard categories (e.g., location sharing, polls). Set your own type string to identify the custom message.

Interactive

Messages with embedded UI elements users can interact with directly in chat. Types: form, card, customInteractive.
See Interactive Messages for full details.

Action

System-generated messages triggered by actions on group members or messages. Represented as Action objects. Types: groupMember, message. The action property specifies what happened: For groupMember: joined, left, kicked, banned, unbanned, added, scopeChanged For message: edited, deleted

Call

Call-related messages. Types: audio, video. Represented as Call objects. The status property indicates the call state: initiated, ongoing, canceled, rejected, unanswered, busy, ended.

Next Steps

Send Message

Send text, media, and custom messages

Receive Messages

Handle incoming messages of all types

Additional Message Filtering

Filter messages by category, type, and other parameters

Interactive Messages

Create and handle interactive form and card messages