LegacyChat -> TextChatService - Can you only view and modify messages on the client now?

I am porting my chat system from LegacyChatService to TextChatService today, and it feels like functionality has been lost between the two services.

My old chat system could, on the server, receive messages from the client, and then if they contained specific keywords, change the messages to another message, then send that modified message to all clients (making it look like the player said something they didn’t).

This was used in a murder-mystery game to keep things more exciting, as sometimes you couldn’t trust what a player would say. It also kept things from being toxic, as I had a blacklist of words that if said would transform the players chat into some of the following:

		"I like long walks on the beach and playing Nevermoors",
		"Please go easy on me, this is my first game!",
		"You're a great person! Do you want to play some Nevermoors with me?",
		"In my free time I like to watch cat videos",
		"If the Dreamsphere is infinite, how does the sun revolve around it?",
		"Hello everyone! I am an innocent player who loves everything Nevermoors.",
		"Plz give me doggo memes!",
		"I heard you like Nevermoor, so I built a computer in Nevermoor in which you can Nevermoor while Nevermooring in your Nevermoor.",
		"I sometimes try to say bad things then this happens :(",
		"Maybe we can have a rematch?",
		"Behold, the great and powerful, my magnificent and almighty nemesis!",
		"Your clicks per second are godly O__O",
		"What happens if I add chocolate milk to macaroni and cheese?",
		"Can you paint with all the colors of the wind",

I also was able to easily choose which players to send specific messages to from the server. Are the functionalities I mentioned in this post present in TextChatService, specifically on the server? I’m having a hard time understanding if any chats can be modified or even viewed server-side anymore, it looks like you can only view/edit messages from the client now.

If this is true, feel like having the messages send to all clients then working on them client-sided will lead to any exploiters being able to see all messages and gain an advantage. Either way, I’d love if someone could help me understand the new system and if I can modify player messages from the server.

There’s probably some top-secret method that someone will post here later on…

In the meantime, here’s a script you can use to re-enable the original Legacy chat without it breaking. Place it in ServerScriptService:
LegacyChatLoader.rbxm (39.8 KB)

Anyone curious:

-If you want to modify messages, you have to do it on the client. You can use TextChatService.OnIncomingMessage to monitor incoming chats, and edit them before they display to the local player.

-If you want to monitor messages on the server, you can do this by listening to any specific text channel using TextChannel.ShouldDeliverCallback, which is a function that contains a chatted message and the name of its sender. Keep in mind you can’t modify this text in any way. Returning true means the message will send to the TextChannel, while returning false means it’ll be deleted.

The flowchart here is pretty helpful for understanding the new system: Text chat overview | Documentation - Roblox Creator Hub

I much prefer how it was in LegacyChatSystem, and do not appreciate its deprecation. The solution for me here is making a custom UI system with TextChatService and hoping exploiters don’t snoop around too much.

It works by having the message go from client → server → client, and then sent through TextChatService, via SendAsync(). This way, the Lua Chat System backend still works, but filtering is done through TextChatService

However, messages sent to only some players can be snooped by anyone, because I have not implemented ShouldDeliverCallback. If a client receives both an unfiltered message from the Lua Chat System backend, and a filtered version of that message through TextChatService, it’ll display the message, but if it only receives a filtered message with no unfiltered message from the Lua Chat System, it doesn’t display the message, but the message could be accessed by an exploiter.

I might implement it, but is hasn’t been a priority