Skip to main content
Quick Reference - Message categories and their common types:
// Check message category and type
const category = message.getCategory(); // "message" | "custom" | "action" | "call" | "interactive"
const type = message.getType();         // "text" | "image" | "video" | "audio" | "file" | custom type
The diagram below helps you understand the various message categories and types that a CometChat message can belong to.
As you can see in the above diagram, every message belongs to a particular category. A message can belong to one of the 5 categories:
  1. Message
  2. Custom
  3. Action
  4. Call
  5. Interactive
Each category can be further classified into types.

Message

A message belonging to the category message can be classified into one of the following types:
TypeDescription
textA plain text message
imageAn image message
videoA video message
audioAn audio message
fileA file message

Custom

In the case of messages that belong to the custom category, there are no predefined types. Custom messages can be used by developers to send messages that do not fit in the default category and types provided by CometChat. For messages with the category custom, the developers can set their own type to uniquely identify the custom message. A good example of a custom message would be sharing location coordinates. In this case, the developer can decide to use the custom message with type set to location.

Interactive

An InteractiveMessage is a specialized object that encapsulates an interactive unit within a chat message, such as an embedded form that users can fill out directly within the chat interface. This enhances user engagement by making the chat experience more interactive and responsive to user input.
TypeDescription
formFor interactive form messages
cardFor interactive card messages
customInteractiveFor custom interaction messages
To learn more about Interactive messages, please refer to the Interactive Messages guide.

Action

Action messages are system-generated messages. Messages belonging to the action category can further be classified into one of the below types:
TypeDescription
groupMemberAction performed on a group member
messageAction performed on a message
Action messages hold another property called action which determines the action that has been performed.

groupMember Actions

ActionDescription
joinedWhen a group member joins a group
leftWhen a group member leaves a group
kickedWhen a group member is kicked from the group
bannedWhen a group member is banned from the group
unbannedWhen a group member is unbanned from the group
addedWhen a user is added to the group
scopeChangedWhen the scope of a group member is changed

message Actions

ActionDescription
editedWhen a message is edited
deletedWhen a message is deleted

Call

Messages with the category call are calling-related messages. These can belong to either one of the 2 types:
TypeDescription
audioAudio call
videoVideo call
The call messages have a property called status that helps you determine the status of the call:
StatusDescription
initiatedWhen a call is initiated to a user/group
ongoingWhen the receiver of the call has accepted the call
canceledWhen the call has been canceled by the initiator of the call
rejectedWhen the call has been rejected by the receiver of the call
unansweredWhen the call was not answered by the receiver
busyWhen the receiver of the call was busy on another call
endedWhen the call was successfully completed and ended by either party

Next Steps