Skip to main content

Chat profanity filters

Last updated on October 24, 2024

Overview

A chat profanity filter is a system designed to automatically detect and filter out inappropriate language and content from user-generated text within chat applications. The implementation of a profanity filter is crucial for maintaining a positive and respectful user experience, preventing offensive content, and complying with community guidelines. Profanity can include explicit language, hate speech, and other forms of offensive content. The filter is capable of recognizing and handling various types of inappropriate language. The figure below shows how the chat profanity filter works:

Image shows how the feature works

This article provides information on how to manage your profanity filter.

Prerequisites

PermissionsActionUsage
ADMIN:NAMESPACE:*:CHAT:PROFANITYCREATE, READ, UPDATE, DELETETo register, query, update and delete profanity word.

Manage chat profanity filters

  1. Log in to the AccelByte Gaming Services (AGS) Admin Portal.

  2. Navigate to the game namespace for which you want to add a chat profanity filter.

  3. On the sidebar, go to Social > Chat > Chat Profanity Filter. If no words have been added yet, the page is blank and the chat profanity filter's status is inactive.

    Image shows how to access chat profanity filters

  4. Click + Register Profanity, then enter the following details:

    Image shows how to register profanity word

    • Profanity: Enter a word that you want to be filtered.
    • False Negative: Add list of words that contains the default profanity word and will be censored when used (e.g., profanity word ass, false negative asshole).
    • False Positive: Add list of words that contains the default profanity word and will not be censored when used (e.g., profanity word ass, false positive mass).
  5. Click Save.

User-specific profanity configuration

To give your players the option to enable or disable the profanity filter for their game accounts, use this code:

FAccelByteModelsSetUserChatConfigurationRequest UserChatConfiguration;
UserChatConfiguration.Config.ProfanityDisabled = true; // Set true to disable profanity for current user

FApiClientPtr ApiClient = FMultiRegistry::GetApiClient();
ApiClient->Chat.SetUserChatConfiguration(UserChatConfiguration
, AccelByte::Api::Chat::FSetUserChatConfigurationResponse::CreateLambda(
[&](const FAccelByteSetUserChatConfigurationResponse& Response)
{
UE_LOG(LogTemp, Log, TEXT("Set user chat configuration success."))
}), FErrorHandler::CreateLambda(
[&](int32 ErrorCode, const FString& ErrorMessage)
{
UE_LOG(LogTemp, Log, TEXT("Set user chat configuration failed. ErrorCode: %d, ErrorMessage: %s"), ErrorCode, *ErrorMessage)
}));