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, configuring rules, and managing flagged messages, see the Moderation Overview.
Prerequisites
Before using AI Moderation, ensure the following:- Moderation is enabled for your app in the CometChat Dashboard
- Moderation rules are configured under Moderation > Rules
- You’re using CometChat SDK version that supports moderation
How It Works
Supported Message Types
Moderation is triggered only for the following message types:Moderation Status
ThegetModerationStatus() method returns one of the following values:
Implementation
Step 1: Send a Message and Check Initial Status
When you send a text, image, or video message, check the initial moderation status:- Kotlin
- Java
Step 2: Listen for Moderation Results
Register a message listener to receive moderation results in real-time:- Kotlin
- Java
Step 3: Handle Disapproved Messages
When a message is disapproved, handle it appropriately in your UI:- Kotlin
- Java