Filtering in Roblox Studio for plugins

Hello, im currently creating a plugin where you’re able to export themes & selections to a store that other people can access & download.

My current problem is that whenever you publish something, you’re able to type whatever you want, im currently using TextChatFilter for the user that is currently logged in, however the text chat filter gets bypassed due to studio not filtering anything whenever a server is not active.

Is there anyway I can get around this? Here’s my code sample:


ThemeInfo.Name = files.Datastore:FilterText(
				Viewer.ThemeName.Input.Text
			)
			
			Viewer.ThemeName.Input.Text = ThemeInfo.Name


function DataStore:FilterText(Name)
	local Player = Info.Player
	local UserId = Player and Player.UserId
	
	if not UserId then
		return ""
	end
	
	local result = TextService:FilterStringAsync(
		Name,
		UserId,
		Enum.TextFilterContext.PublicChat
	)
	
	return result:GetNonChatStringForBroadcastAsync()
end

My idea would be to mark the theme as “unfiltered” and hide it from being visible.
Once a server starts up, look for unfiltered themes, and filter their names.
When it’s filtered. mark it as such, so it can be visible to players again.
(Alternatively, hide the name only, or make a placeholder like “Theme by [USER]”)

Of course, you should notify the user of this.

1 Like