Hi, I've been recently trying to test and so some stuff with the filtering function from the text service however I have no idea on how can I get the content out from the filter
game.ReplicatedStorage.Chat.SendMessage.OnServerEvent:Connect(function(player, message) local success, result = pcall(function() return TextService:FilterStringAsync(message, player.UserId) end) if success then print(result) end end)
Whenever I print the result it just gives me an Instance and I can't find anything about it's content within the Roblox wiki, how can I extract the message from it?
The method FilterStringAsync
of TextService returns a TextFilterResult Object. This Object contains it's own functions that allows you respectfully fit the filtered string for different cases.
In your case, you're looking for GetChatForUserAsync:
Result:GetChatForUserAsync(Player.UserId) --// The argument supplied should correlate to the recipient's UserId.