Profanity filter callback
The Nexconn Chat SDK provides built-in content moderation to filter sensitive or inappropriate content.
How it works
Content moderation is applied automatically on the server when messages are sent. If a message contains blocked content, the server returns an error code, or the message is silently filtered, depending on your configuration.
Client-side moderation callback
Register a MessageHandler to receive blocked message events:
TypeScript
import { NCEngine, MessageHandler, MessageBlockedEvent } from '@nexconn/chat';
NCEngine.addMessageHandler('moderation-handler', new MessageHandler({
onMessageBlocked(event: MessageBlockedEvent): void {
console.log('Message blocked:', event.info);
// Show the user that their message was blocked
},
}));
Configure moderation (server API)
Content moderation is configured through the Server API. See the Server API documentation for:
- Custom word filter management