Server-sided chat filtering

I was wondering, if a chat message gets filtered, do server-sided scripts still have access to the original message?

Example of why I’m asking this:
Imagine you are using some server-sided script that wants to display the message to other players, would you have to filter it again?

The chat message isn’t filtered during the Player.Chatted event.

6 Likes

No, if you’re implying that the message is not player-created but as a string you pre-made in studio then you don’t have to filter it
EDIT:
Yeah as Kampf has mentioned, .Chatted is not filtered

2 Likes

Everything that has user input which will be displayed has to be filtered manually through your script. Chatted does not filter it for you, it’ll return the raw message. If you want to display said message on a ScreenGui, SurfaceGui, announcement, etc. you’ll have to filter it.

https://developer.roblox.com/articles/Text-and-Chat-Filtering

2 Likes

You really shouldn’t filter messages for server usage in the first place. The only time in which you actually need to filter messages is if the client requires access to them or can see them, especially for display purposes. Filtering of course must be handled on the server and the results passed to the client, but you do not need to filter a string before you can use it around the server (i.e. parsing messages).

No text input is filtered. The server will always have access to the original message unless you are not holding onto it through a variable of some kind.

Don’t know what you mean by “again”. You don’t have to filter it to start with, the server will receive whatever it’s sent, filtered or not. The server just recognises it as a “string”, not as a filtered or unfiltered message. If you want to make the server use that text to display on something or give the text to other clients, yes of course you have to filter it.

1 Like

I was wondering if it reached the server filtered already. I shouldn’t have used ‘again’. Thanks for the extra info.

1 Like