When using TextService followed by GetChatForUserAsync on the returned object, the function returns an empty string instead of the filtered message content. This occurs both in Roblox Studio and in published games.
Create a script in ServerScriptService with the following code:
local TextService = game:GetService("TextService")
local Players = game:GetService("Players")
-- Wait for a player to join to test with
local function testFilter()
local player = Players:GetPlayers()[1]
if not player then
print("Waiting for a player to join...")
task.wait(2)
return testFilter()
end
local userId = player.UserId
local testMessage = "Hello world! This is a test message 123"
print("Original message:", testMessage)
local success, filteredResult = pcall(function()
local filteredTextObject = TextService:FilterStringAsync(testMessage, userId, Enum.TextFilterContext.PublicChat)
return filteredTextObject:GetChatForUserAsync(userId)
end)
if success then
print("Filtered message:", filteredResult)
else
print("Filtering failed with error:", filteredResult)
end
end
-- Run the test
testFilter()
Actual result: The filtered message is empty, as shown in the console output:
Original message: Hello world! This is a test message 123
Filtered message:
This happens when I publish this script to any experience, group or otherwise. This also fails even in studio after publishing to a place, which is odd because filtering shouldnāt occur in studio from my experience.
here is a test place file that you should publish and then test to see the same result: filter-test.rbxl (55.4 KB)
Expected behavior
Expected result: The filtered message should be displayed in the console and match the original input (since it contains no inappropriate content).
The issue is occuring across multiple games now, slowly spreading to those larger and larger. Itās becoming a more spread issue where even messages thare not being directly filtered are not being sent - including via the chat bubble and the chat box. Itās affecting games to the point their unplayable if you require the chat filter/service for example within roleplay games (namely ER:LC etc) you are unable to communicate with others in regards to roleplay messages - including the radios and other in-game aspects considering messages are returning a chat filter error. An error is additionally logged in console on the client namely stating:
Failed to translate string with key: InGame.ConnectioNError.DisconnectCLientRequest
Stack Begin
Script 'CoreGui.RobloxGui.CoreScripts/AppChatMain'', Line 18
Stack End
We canāt filter texts using TextService and ChatService since they took it away. This is going to break every game with message systems such as commands, dialogues, and many more.
Had this occur with a groups various different experiences yesterday, basically around the time they said they where finally migrating places to TextChatService.
Also noticed this, and even swapping from Chat filtering to TextService filtering didnāt fix it. I had to swap over to bubble chat temporarily just so basic chat functionality works.
(How do you mess up this badly???)
GetChatForUserAsync has been partially deprecated and now will return an empty string when called from the client.
āText filtering pertaining to chat should be done through TextChatService and experiences that do not properly filter player-generated chat text might be subject to moderation.ā
Iām not sure whether you can access the per-user filtered string anymore, but you definitely can from the clients, so you might have to rethink the logic a bit.
GetChatForUserAsync is being deprecated as part of the migration to TCS. TextChatService handles filtering for you for chat, so you donāt need this API anymore. The other APIs, GetNonChatStringForBroadcastAsync and GetNonChatStringForUserAsync are still supported.
The deprecation warning was very subtle for such a damaging change. Is there any way we can access the filtering system or store results in single instances like we did before? This makes it hard to have systems where chatting history is saved by the server and then deployed to clients based on their filtering settings.
After looking further I did find a ātutorialā about this
but for all things holy, why is it so over complicated? A single function allowing for text filtering between two users would be literally all you need. If I have a global chat system on the server using .chatted for example, I now have to go research like 8 different instances and functions just to have the same functionality.
Literally trying to convert it as Iām typing this and it feels like the 12 labors of Hercules just to understand basic functionality, itās been like 30 minutes and Iām only now getting the server to pick up on a single message using the new systems. Furthermore itās such a pain to work with that if I want my current code to work well with the new system I have to scrap large portions of it. It might be easier to just plug into GetNonChatStringForBroadcastAsync regardless.
TL;DR if Iām getting this right, not a bug but just intentionally made harder to use for the gain of āparental control and community standardsā, with the only alternatives for custom chat requiring excessive work for re-implementation.
EDIT; After looking at some other posts as well, I think itās meant to replace basic chat but the functionality required to replace higher end systems such as custom chats isnāt really easily there, especially getting that info on the server, unless Iām forced to I really see no point in attempting to completely convert to TextChatService when it has so many more downsides in terms of converting older systems that just using GetNonChatStringForBroadcastAsync can do 100x easier.