Skip to main content
Supported types: Text, Image, Video messages only Statuses: "pending" -> "approved" or "disapproved"
AI Moderation automatically reviews messages for inappropriate content in real-time. When a user sends a text, image, or video message, it’s held in a pending state while the moderation service analyzes it, then marked as approved or disapproved via the onMessageModerated event. getModerationStatus() is available on TextMessage and MediaMessage objects. Custom messages are not subject to moderation.
For configuring moderation rules and managing flagged messages from the dashboard, see the Moderation Overview.

Prerequisites

  1. Moderation enabled in the CometChat Dashboard
  2. Moderation rules configured under Moderation > Rules
  3. CometChat SDK version that supports moderation

How It Works

Supported Message Types

Moderation Status

The getModerationStatus() method returns one of the following string 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:

Step 2: Listen for Moderation Results

Register a message listener to receive moderation results in real-time:

Step 3: Handle Disapproved Messages

When a message is disapproved, handle it appropriately in your UI:
Always remove listeners when they’re no longer needed (e.g., on component unmount or page navigation). Failing to remove listeners can cause memory leaks and duplicate event handling.

Next Steps

Flag Message

Allow users to report inappropriate messages manually

AI Agents

Build intelligent automated conversations with AI Agents

AI User Copilot

Smart replies, conversation summaries, and more

Send Messages

Send text, media, and custom messages