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.
Messages may be blocked when:
- Text content matches a built-in profanity word.
- Text content matches a custom profanity word set to block.
- A pre-messaging webhook rule blocks the message before delivery.
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: