Overview
AI Moderation in the CometChat SDK helps ensure that your chat application remains safe and compliant by automatically reviewing messages for inappropriate content. This feature leverages AI to moderate messages in real-time, reducing manual intervention and improving user experience. For a broader understanding of moderation features, see the Moderation Overview.What Triggers Moderation?
Moderation is triggered only for the following message types:- Text Messages
- Image Messages
- Video Messages
Handling Message Moderation Status
When sending text, image, or video messages, the moderation process introduces the following changes to the message flow:-
Initial Status:
- On successfully sending a text, image, or video message, the response will include the moderation status as
pending
. - You can fetch this status using the
moderationStatus
property, which returns an Enum:CometChat.ModerationStatus.PENDING
.
- On successfully sending a text, image, or video message, the response will include the moderation status as
-
Moderation Result Event:
- Once the moderation service processes the message, a real-time event is triggered in your
MessageListener
asonMessageModerated
. - This event provides the message object with the updated moderation status, which will be either
CometChat.ModerationStatus.APPROVED
orCometChat.ModerationStatus.DISAPPROVED
.
- Once the moderation service processes the message, a real-time event is triggered in your