Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
// Get available flag reasonsconst reasons = await CometChat.getFlagReasons();// Flag a messageawait CometChat.flagMessage("MESSAGE_ID", { reasonId: "spam", remark: "Promotional content"});
Flagging messages allows users to report inappropriate content to moderators or administrators. When a message is flagged, it appears in the CometChat Dashboard under Moderation > Flagged Messages for review.
For a complete understanding of how flagged messages are reviewed and managed, see the Flagged Messages documentation.
Before flagging a message, retrieve the list of available flag reasons configured in your Dashboard:
TypeScript
JavaScript
CometChat.getFlagReasons().then( (reasons: CometChat.FlagReason[]) => { console.log("Flag reasons retrieved:", reasons); // reasons is an array of { id, reason } objects // Use these to populate your report dialog UI }, (error: CometChat.CometChatException) => { console.log("Failed to get flag reasons:", error); });
CometChat.getFlagReasons().then( (reasons) => { console.log("Flag reasons retrieved:", reasons); // reasons is an array of { id, reason } objects // Use these to populate your report dialog UI }, (error) => { console.log("Failed to get flag reasons:", error); });