How to filter text content for 17+ experiences with TextService's "FilterStringAsync()"

  1. I want to allow users to submit, and retrieve text content to/from a datastore that is not done through the standard Roblox chatbox. (Using my own GUI elements) I want the content to be limited by the rules of the 17+ experience guidelines. I currently know that “TextService:FilterStringAsync()” is the standard way to filter text content to achieve the goal, however it’s too restrictive relative to what can be said in the standard Roblox chat GUI.

  2. It is not clear to me that there is way to use “TextService:FilterStringAsync()” in such a way that it adjusts to the 17+ experience guidelines. Is this automatically detected by the 17+ settings related to the experience the code sits in? Has Roblox not created this functionality yet? Is there another endpoint I need to use?

  3. I’ve not seen any documentation in the “TextService” page, nor in the community guidelines which answers this question.

1 Like

Anyone know if this endpoint has been updated to account automatically for 17+ experiences?

1 Like

Testing it in a game I just created, yes, it does assuming your game has enabled strong language.

Left is pre-filter, right is post-filter. Censored so I don’t get punished but I’m sure you can imagine what curse word starts with S and ends with T.
image

function script.Parent.RemoteFunction.OnServerInvoke(p, t)
	return game:GetService('TextService'):FilterStringAsync(t, p.UserId, Enum.TextFilterContext.PublicChat):GetChatForUserAsync(p.UserId)
end
2 Likes

Great, I’ll go create a request for them to update the documentation to indicate it detects and auto-updates according to the game’s 17+ settings. Thank you!

2 Likes

FYI I don’t have high enough forum permissions to request documentation changes - can’t post on those forums - if anyone else comes along and wants to take that task.

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