Yes, we allow you to monitor all chat activity and moderate messages to avoid profanity or attacks from bad actors who might be misusing the application. There are a few ways to add moderation to your application.


1. Filter in-flight messages for profanity

Use our Profanity Filter Function to moderate the content of chat messages in realtime as they go over the PubNub Data Stream Network. The function detects objectionable text in chat messages by checking against a dictionary of swear words and allows you to replace the swear words or block the entire message from being published to other users in the application.


2. Update and delete messages

A moderator can receive messages in chat rooms by subscribing to spaces or by calling history to fetch past messages that were published in a space. If a message has inappropriate content, the moderator can take action to update or delete the message using the Message Actions API. The update or delete action will be sent to all users in the chat room and it will be tied to the original message in storage.


If the original message needs to be completely removed from our storage it can be done using the Delete API. Note that the delete flag should be enabled on your key settings in the PubNub Dashboard in order to use the Delete API.