I’m working on a custom chat system, and I’m having difficulties checking whether a player can chat. The criteria I’m working with are aligned with ROBLOX’s ToS:
The user’s age bracket (13+ can chat)
The user’s privacy settings (where chat can be disabled)
I’ve had a go proxying the ROBLOX web API - but that requires an authenticated user upon request.
I’ve found this old post suggesting that I use ChatService, which I know to be in the process of being deprecated. Thus, I’ve browsed the documentation for the newer TextChatService, but there’s seemingly nothing similar to getting a player’s privacy settings.
Am I missing something? Is there an endpoint or service I can call somewhere for this?
I don’t think there is a way to do this other than what you found in the old post. But Roblox never really fully removes any features, they only deprecate them, so it should be fine to use ChatService for this one specific thing.
To get some form of Estimate of their age, you can use PolicyService:GetPolicyInfoForPlayerAsync(), using this will give you a piece of Data to tell what is Allowed for the Player, If you see that indexAreAdsAllowed is true, It means that the User is 13 or older, as Ads can only be by User over the Age of 13 due to a Policy Change a while back.
Using TextChatService, Within a TextChannel, Roblox will add a TextSource for every Player to use the TextChannel, and check for the Property CanSend, which determines whether the player can chat or not.
This is just Bad Advice, when Roblox Deprecated things, Its because they are Discontinued, No Longer work, or are Superceded by a newer Version, The only reason they are still usable is to keep older games working.
I know that, but if the only way to do it is that way (which I thought it was), then you should do it. Also, your way isn’t as reliable because if the policies of Roblox change, the game will be broken, but if the solution I offered gets deprecated, the game will still work.
Only issue is that my chat system doesn’t use ROBLOX’s native one (I did a hackathon a while back and designed a very primitive system with BillboardGuis, so I doubt using TextChatService would be feasible.
I’m tempted to go with the ads route you mentioned, but I’m cautious as I’ve known ROBLOX to change things drastically over time, and I don’t want chat breaking throughout my games if ads change! It’s also a little tangiental to the next programmer that works with my code. Plus, this doesn’t satisfy both criteria (what if a user has disabled their chat manually?) Ergo, I’ll probably work with deprecated stuff until something is added to check this for me!
Anyhow, I appreciate the feedback! I’ll wait to mark this thread as solved in case anything else turns up.
I should add that I’m only trying to get an age bracket here (13+ or <13) - not an age itself.
Then an Alternative Method would be to check whether the Chat will Filter or unfilter something, Since your Chat changes when you are older than 13, you can use that to determine whether they older or younger by checking if a Word will get filtered.