"Moderating" chat?

Hello, I’m currently working on a project. It’s basically an investigation game and relies solely on the chat to communicate. When it comes to Roblox, people aren’t the most, formal, to say the least. Grammar is usually laughed upon in any game. Is there any way to “moderate” any chat message to at least have the first letter capitalized and some punctuation?

(Also, is there any way to disable the chat mid-game?)

2 Likes

You could fork the chat system. Disable anything that isn’t an alphanumeric character or basic punctuation. Automatically capitalize the start of sentences. Put a period at the end of the sentence if the player is missing it. Put text in a nice font.

Be warned though, that you may inadvertently make your game no fun :slight_smile:

Edit: Also, I’m not sure how localization would fit into this.

4 Likes

I am uncertain about the variable turning on and then off of the chat. The best method I believe would be to use this method to disable the system chat. I am not certain if this works while in game. The only other issue with this is, you will have to create your own chat system. And then modertaing that chat system, will be a two fold level of difficulty. I would recommend instead using Chat and when you want to disable their chat, you can mute their chat ability.

Now as to the grammar checks… Again utilizing the chat service, you would have to check each sent message’s first character, and last character, which you can do by using string.sub()
string.sub takes three arguments, the string you are checking, the start character location within the string and the optional end character location within the string.
An Example, if I wanted to get the first and last characters of a string chattedMessage
I would do

    local length = #chattedMessage
    local firstChar = string.sub(chattedMessage,0,1)
    local lastChar = string.sub(chattedMessage,length)

and of course you can use other string capabilities ( string.gmatch()) in order to check for banned words, common grammar mistakes etc…

1 Like

It’s not a matter of pure moderation, it’s for aesthetic. I just try to do this and help my game function better and so people can communicate better. It’s not game-changing.

I wasn’t ranting. I was giving information on the subject. Blacklisting words isn’t a good solution. You can use string functions to make a blacklist if you really want to.

That is entirely alright. You have no need to respond to someone who spent time trying to devalue your issue because of their own personal grievances with the system. I will say, there are quite a few existing resources detailing a good tutorial on accomplishing what you need. I wish you luck with this and everything else. :slight_smile:

I’m mostly just being silly, but you could also port/create an API for a project like this (demo here) to use a neural network to automatically add grammar to chat :slight_smile:

I don’t even want to think about how one would go about doing that. Porting an auto grammar adder to lua.

You could host your own API and keep it in python. Actually, the site looks like it provides an API. Probably shouldn’t ruin a good thing by taking advantage of it though…