So I made a game that uses to chat, and I don’t know how to filter the incoming text, since there isn’t an actual player sending it. How do I go about filtering this?
I don’t understand what you mean. If there isn’t a player sending the text, how is the text being sent?
Basically a robot sends the text, not a player.
The issue is that I need a fromUserId but I can’t get that if it doesn’t come from a player
…Please look at the other methods. There is clearly a GetNonChatStringForBroadcastAsync
method.
In order to get a TextFilterResult I need a sender ID for FilterStringAsync
Are they being arbitrarily generated or are they predefined strings?
If they’re predefined and cannot be manipulated by clients then they don’t have to be filtered. Filtering is only required when working with strings where you cannot guarantee with 100% certainty that input text will be appropriate (so from another source that randomly generates strings, from other players, randomly generated letters, et cetera).
If you are working with randomly generated strings that do not necessarily have a sender, you can probably use TextService:FilterStringAsync(text, receiver, context):GetChatForUserAsync(receiver). Make the sender user ID the same as the receiver user ID. Do this for each player who is receiving the text.
There was a document on this on the dev hub when that was a thing but it doesn’t exist anymore. It can be accessed from the wayback machine though:
https://web.archive.org/web/20190710120519/https://developer.roblox.com/en-us/articles/Text-and-Chat-Filtering
And the place file it used:
Thanks!
30letterissueman!!!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.