Message Structure and Hierarchy
The below diagram helps you better 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 either one of the 4 categories
- Message
- Custom
- Action
- Call
Each category can be further be classified into types.
#Message
A message belonging to the category message
can be classified into either 1 of the below types:
- text - A plain text message
- image- An image message
- video- A video message
- audio- An audio message
- file- A 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 very good example of a custom message would be the sharing of location co-ordinates.
In this case, the developer can decide to use the custom message with type set to location
.