QuickBlox Documentation

QuickBlox provides powerful Chat API and SDK to add real-time messaging and video calls to your web and mobile apps. Learn how to integrate QuickBlox across multiple platforms.

Chat Moderation

Learn how to moderate your chat in real-time.

Trust & Safety (TnS)

🚧

This feature is available for customers on the Enterprise plan only. Take advantage of Enterprise features to unlock new value and opportunities for users. For more information and if you want to request a Demo, please contact us by mail: [email protected].

QuickBlox Profanity Filter lets you moderate your chat messages in real-time. The functionality identifies inappropriate words and phrases in a collection of text and lets you mask the unwanted content in a variety of different ways. Thus, whenever the user publishes a message, the functionality scans the text for profanity and either masks the word or blocks the user.

The tool does not require manual moderation and works on the go. Just create separate rules for each word or regexp (regular expression) you need to replace or use a predefined list with words saved in .txt file. The feature is built around two concepts:

  • A rule allows you to define your automated moderation practices by assigning certain filtering criteria.
  • A score group defines filtering behavior based on the score provided; works in conjunction with the rule.

Create a rule

First, let’s create a moderation rule:

  1. Log in to the Dashboard.
  2. Locate the app you need to create a rule for.

🚧

The rule being created will work for the chosen application only. You need to create a rule for each application individually.

  1. Locate the Chat menu item at the left section of the screen.
  2. Locate the TnS tab at the right upper right corner of the screen.
  3. Click the Add message rule button.
  1. Locate the Name field and enter the name of the rule.
  2. Move to the Mask field and enter the symbols to be used instead of the inappropriate word.
  3. Move to the Score field and enter the score indicating how bad the word is. Set the value from 1 to 1000 for this field.
  4. Enter the RegExp. The RegExp is a sequence of characters that define a search pattern; used mainly for pattern matching with strings, or string matching. For example, "find and replace" and other similar operations.
  5. Locate the String field and enter the words that should be filtered.
  6. Mouse over the Choose File button next to the Find dictionary option and upload a file with the words that should be filtered.
  7. Click the Save rule button.

If you want to upload a file, use the .txt file. The cognates order in the dictionary should
be from the longest to the shortest. See the screenshot below.

πŸ“˜

Note

It is possible to save the value in the RegExp and String fields (or Find dictionary) at the same time but the RegExp field has a bigger priority.

Add a score group

To add a score group, proceed as follows:

  1. Locate the same Chat => TnS tab.
  2. Click Add score group button.
  1. Set an extreme score value within the Score field.
  2. Set the Block option.
  3. Click the Save rule button.

🚧

Pay attention

  • If the total score set for a score group is less than a score set for a new rule, the message will be blocked by TnS system. The total score can be numbered from 1 to 100 000.
  • If the total score set for a score group is more than a score set for a new rule, the inappropriate word will be masked by TnS system. The total score can be numbered from 1 to 100 000.

Let’s see how it works:

  1. Send a message via a mobile app with inappropriate words and with a total score more than the extreme value.
  2. Locate Chat => Messages history pop-up and review the table with messages. The message can be displayed with blocked_by=<array_of_rules_ids> custom parameter and will not be delivered to the recipient or it can be masked.

The message is blocked.

The message is masked.

Ban a user

You can ban a user account, so the user can no longer participate in the dialog.

  1. Navigate to the Chat => Bans tab. Click the Add ban button.
  1. Locate the QB User ID field and enter the user ID that is going to be banned.
  2. Enter the ban expiration date within the Expires field.
  3. Click the New ban button.

Updated 2 months ago



Chat Moderation


Learn how to moderate your chat in real-time.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.