What is the new way of filtering text?

My problem lies that the way I used to filter text, being this:
local CharacterName = game:GetService("TextService"):FilterStringAsync(Name, Player.UserId, 1):GetChatForUserAsync(Player.UserId)

No longer works due to it being deprecated. Does anyone know what Roblox is expecting now? Cheers.

3 Likes

Please mark @2112Jay as solution.

Roblox changed the way chat filtering works. Now any and all types of player chats goes through TextChatService so that Roblox can automatically Warn/Ban/Punish players based on their chatting behavior (just like Voice Chat), even in a custom chat menu. Plus, it now supports the ability to see if the user has chat enabled or not.

By the way, if you don’t want to read most of that, if you’re attempting to make your own chat box you must first check if the user is CanUserDirectChatAsync. Here’s something shorter.

2 Likes

Well, I would, but he seems to have deleted it before I could’ve read it!

2 Likes

I’m not exactly sure why, I just gave resources, and he gave you a solution.

2 Likes

Does text inputted into TextBoxes now filter automatically or something, then? Because that’s what I’m trying to filter, unless I can run it through the TextChatService or something, but I’m not seeing any function like that reading through documentations, though I could very well just be not looking hard enough.

Anything a player input’s, text wise, that can be seen by other players has to be put through TextChatService (correctly) or Roblox will forcefully private your game until you fix it. This explains everything.

  • General Safety Tip: You should check with a LocalScript if CanUserChatAsync is false. If so, you should remove/disable the ability to see any text that was inputted by another player. On a sign, in your custom chat box, etc.

You were saying you couldn’t find any resources. That’s because I was sort of wrong. Roblox didn’t make any new resource/function for their new filtering. They changed how the old function works.

1 Like

Same thing happened to me :pensive:

local CharacterName = game:GetService("TextService"):FilterStringAsync(Name, Player.UserId, 1):GetNonChatStringForUserAsync(Player.UserId)

Check if this works

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.