You can select from a list of prebuilt Function Blocks or build your own logic to moderate or restrict content, such as adult content, on your application.
- Sift Ninja is an API that integrates with chat, comments, gaming, and other social applications. Sift Ninja analyzes and filters text based on certain risk levels, and can then automatically moderate, hash out profanity, or mark as NSFW, all fully customizable.
- Neutrino's Bad Word Filter API detects profanity in text, and offers a variety of censoring options.
Some Blocks require third-party service signup
When Blocks integrate with third-party services, such as Amazon, Librato, MapBox, or RingCentral, the services often require account setup to use them. Please make sure to visit each Block's documentation page, located in the Blocks Catalog, to learn what's required.
Sift Ninja Function Code
Setting up the Function
To add the PubNub Function, do the following:
Create a new function. Go to your PubNub Dashboard and create a new module, and then create a new Before Publish function. The function should be set up to trigger on a specific set of channels (such as
chat.*) or on all channels using wildcards (
Copy the function code from above. You'll need to update the API key for the service from your account.
Click Start module to start the function, and test it using the Test Payload field and Publish button on the left.
Testing the Function
Input: Publish a message on any channel with a text field included.
Output: The Sift Ninja response will be appended to the original message. The response will include tags to identify if the message is inappropriate. The function code can be modified to block these messages from getting published to other users.