Can I Develop my own Chat Filtering System? Is it allowed?

I honestly do not know where else to post this on the DevForum. Forgive me if this is the wrong place.

So I am creating a game that will have a server chat, but I want to make said chat fit a little bit better to my needs. Instead of tagging out words, I was wondering if it is allowed to make my own blacklisting system? (Sometimes the default filtering system has its faults by tagging out completely fine things).

In my system, instead of tagging words, I would just like to have a warning that tells the user they cannot send it because it is inappropriate.

Of course, I would go through a ton of testing and modifying myself on adding all the words dubbed inappropriate to a blacklist. The blacklist would be stored on the server, therefore no one can access it in-game.

It would be awesome if a Staff member of Roblox could get back with me on this, but anyone who knows whether this is ok or not is also welcome to help me out.

Thanks,
Jon

EDIT: I would make a system that not just blacklists single words, but phrases too that are dubbed inappropriate.

2 Likes

No, this is against the rules - you can apply your own filtering if you wish, but the last step always has to be to the main Roblox filter.

4 Likes

Is it possible to not have the default filtering system post the chat and instead give me more options such as displaying a warning to the player?

1 Like

I believe that’s ok. As long as it’s not going to be displayed to the user, you can play around with it as much as you want.

Chat or any user inputted text for that matter must be filtered if its displayed to other clients.

It is probably fine to add your own text filtering on top of this, but the default filtering must be used.

For more info: https://developer.roblox.com/en-us/articles/Text-and-Chat-Filtering

7 Likes

Yes the chat is highly customizable and you can modify its functionality. https://developer.roblox.com/en-us/articles/Lua-Chat-System

As long as you use Roblox chat filtering you can add your own filtering.

If you don’t show it to the player you don’t got to filter it such as rejected messages but anything that gets displayed needs to.

2 Likes

Make sure to search first before posting. This one’s been asked before.
https://devforum.roblox.com/search?q=custom%20filter%20%23development-support:scripting-support

Here’s a response I made on a similar topic. I say similar because the question here was to use a fully custom filter solution. Adding custom filtering on top of Roblox’s is fine.

1 Like

Is their a way to completely block messages instead of just replacing them with hashtags?

Yes, there is actually. The beauty of the Lua Chat System and it’s extensive customisation options is quite amazing. Here’s a relink to documentation if you need it:

https://developer.roblox.com/en-us/articles/Lua-Chat-System

I don’t recommend blocking out chats without also telling the user why the chat was blocked or that it was in the first place, which is what the hashtags are meant to do. In the end it’s your structure though and I’m offering an unasked opinion.

What you’re going to need to do is create a CommandModule. This is something that will be registered with the ChatService as something to run when a message is sent. First things first; we need our folder. In the Chat service (should appear near the bottom of your Studio Explorer), add a Folder called ClientChatModules. In it, add one called CommandModules. For good measure, add a BoolValue in CommandModules named InsertDefaultModules and check it off.

Inside CommandModules, make a new ModuleScript. Call it whatever you want then open it up. You will need the following boilerplate code when working with a CommandModule:

local util = require(script.Parent:WaitForChild("Util"))
 
function ProcessMessage(message, ChatWindow, ChatSettings)
	
end
 
return {
	[util.KEY_COMMAND_PROCESSOR_TYPE] = util.COMPLETED_MESSAGE_PROCESSOR,
	[util.KEY_PROCESSOR_FUNCTION] = ProcessMessage
}

This boilerplate code is for when a message is completed and should be processed. The code you’re going to write is under the ProcessMessage function. It is a callback, meaning it needs to return something. If the function returns true, the message will stop being processed and the server won’t receive the message to display in the chat. If it returns false, the message will go through.

From this, all we need to do is find a hashtag in our string. If one is found, return true to prevent the message from being sent. Return false as a defaulted value as there will be nothing left to get checked, so we can also assume it failed all checks and thus should be treated as a normal message and sent through.

function ProcessMessage(message, ChatWindow, ChatSettings)
	if string.find(message, "#") then
		return true
	end
	return false
end

Just like that.

4 Likes

What if im not going to use the default roblox chat stuff, I am going to make my own.

If you develop your own chat module, preventing the processing of censored messages is up to your implementation. How this can be done will vary from system to system.

So, if it were only for the individual user to see (I’m making a notepad with the default filter, but its WAY too sensitive), then it’ll be fine?

So ig if I will put additional secure for people in the gamw that might bypass n words and so on, nothing will happen?