Text Filtering a Quote?

If I am going to filter a quote from a API online that I have no control over, and is going to be broadcasted to the entire game, what would I set the UserId to of the player who requested the filtering to?

local TextService = game:GetService(“TextService”)
local filteredName = TextService:FilterStringAsync(QuoteHere, UserID?):GetNonChatStringForBroadcastAsync()

The TextService has a FilterStringAsync service which you use to get the filtered string and send it to clients as filtered by their user id. Basically you could try filtering from the person who it is being sent to. (on fireclient)

2 Likes

I thought about this but was not sure, and you just confirmed it! Thanks!

You also might want to fire to the clients in different threads because of how it yields

Alright, and I would still use :GetNonChatStringForBroadcastAsync() or would I now use :GetChatForUserAsync() (since the quote filtering is now only visible for that player)

^^ Those are called on the TextFilterResult when using FilterStringAsync

or neither?

There’s so much documentation on TextService it is quite confusing. I just want the best way for players & moderation.

EDIT: I will use :GetChatForUserAsync() as now the local player is only able to see it on their client