How would I detect profanity or cursing?

Main Concern:
So I was recently wondering how I could detect when someone uses profanity or something like that. I wish to use it so I can beam their player name and what they said to Discord. Is there a certain module(or function) that roblox has created? I already know how to script the discord part.

Other Concern:
Would I have to manually type in the script the words that I do not want to be said? Would I get moderated by ROBLOX if I do so?

This really may help me as I am a Head Developer for Iceberg Hotels.

Thank you!

1 Like

Keep in mind, we have a discord bot so we can see exactly what they said and we have a command that can permanently ban them. I believe it’s Discord-Trello API. (Trello-Bans via discord bot.)

There is no need to make a script to filter words or I should say a script that holds words that need to be filtered, becuase, yes, roblox already provides a service to do that for you.
Text Filtering | Documentation - Roblox Creator Hub


3 Likes

This is very helpful. I will look into this, thank you.

Just going to point this out, there have recently been threads posted about games getting taken down for using web hooks and not filtering what’s been sent over them. I would advise you to filter it with TextService but if it’s something you can live with then that’s up to you.

1 Like

I could see where you are coming from. I will filter the message that they sent. What I mean is the discord embed would be something like this:

Player Name
(Player)

Reason
Found Bypassing/Swearing

Would that clear it up? Is it against TOS to log their username?

I’m unsure about what are you trying to do here, I assume you’re trying to make a discord embed when a player’s text input gets filtered? If then there is a lot of words filtered other than profanities, wouldn’t that flood the api?

I see how that wouldn’t work. For example when it’s a simple word like ‘ok’ that gets tagged, then it beams to discord and we can ban them. I see how that wouldn’t work out. Thanks.

A webhook is allowed so long as you filter what’s sent to it. Also something you definitely should not do is make your own filter, game’s have been taken down for that as well because people had tables filled with profanities in order to make their own « filter ».

I see how you could say that too. Would Roblox take my game or moderate it for me putting in what they said partially? For instance, a-- or s—? Something like that that doesn’t fully say the word?

My personal advice would be to steer clear from this idea as a whole, anyone who swears in your game can be reported by other users and Roblox moderators can take of it from there. On top of that the Roblox filter works well in most scenarios.

Like I said previously if your keen on doing this be my guest, just be wary of possible moderation action.

2 Likes

Create a swear list table.

 local badwords = {"badword1","freerobux","noooooooooooob"}

and make it
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
for i,v do inpairs(badwords)
if msg = v then
print("bad word detected")
end
end
end)
end)

I don’t think it’s a good idea to send a discord Web hook request for every profanity usage detected, it may or may not hit the limit of the api, I’ve heard of people’s discord being suspended for flooding the api with requests.

Thank you for the information.

If I were to do this, which I probably won’t anymore due to the sufficient amount of advice, I would insert waits into each swearing or profanity detection. That way I can keep my discord from being spammed.

Overall, I probably wouldn’t be doing this.