Skip to main content

Configure Prohibited Words

Apply filtering words configured in the console.

Console Filtering Configuration

Filtering Configuration

  1. Go to Console > Chat > Settings.
  2. Add words needed for filtering.
  3. Words must be separated by commas.
  4. Click the Save button.

Method Information

MethodDescription
FetchFilterWords()Fetch prohibited words list from server
Filter(string message, char separator = '*')Apply prohibited word filter to message

Parameters

Filter Method

ParameterTypeDescription
messagestringMessage to filter
separatorcharCharacter to replace prohibited words with (default: '*')

Unity C# Usage Example

using UnityEngine;
using UnityEngine.UI;

public class ChatExample : MonoBehaviour, IChatListener
{
public InputField _inputChat;
public Text _textView;

public void OnConnected()
{
Debug.Log("Chat Connected");
// Fetch prohibited words list on successful connection
ChatManager.Instance.FetchFilterWords();
ChatManager.Instance.Subscribe("CH01");
}

public void SendMessage()
{
// Send message with prohibited word filter applied
ChatManager.Instance.SendPublicMessage("CH01", ChatManager.Instance.Filter(_inputChat.text));
_inputChat.text = "";
}

public void OnPublicMessage(ChatUserInfo sender, string message)
{
// Apply prohibited word filter to received message
_textView.text += $"\n[{sender.visitorName}] {ChatManager.Instance.Filter(message)}";
}

public void OnPrivateMessage(ChatUserInfo sender, string message)
{
// Apply prohibited word filter to whisper
Debug.Log($"[Whisper from {sender.visitorName}] {ChatManager.Instance.Filter(message)}");
}

public void OnNotifyMessage(ChatUserInfo sender, string message)
{
Debug.Log($"[System] {message}");
_textView.text += $"\n[{sender.visitorName}] {ChatManager.Instance.Filter(message)}";
}

// ... Other IChatListener method implementations
}