Penguin-Pal wrote:
Just to make this clear, are you trying to:
- If a user hits "Enter" but their message contains a word in the filter, cancel the message sending and instead warn the user about it.
- If the user has already sent the message and everyone in the room can see it in main chat, do something with it.
- Other?
Basically, I'm trying to see what has been sent into the chat. Say a user posts a message, everyone sees it and it says something like "Shit": I want my code to be able to see that word and post a message (through a user account automatically) into the chat that says "Usernamehere, please don't use profanity". That would cover your second bullet point.
Now obviously I'm not going to go and add every single bad word into the filter, but really bad words that are racist and slurs should be picked up by my code and a message sent to the main chat.
By message, I don't refer to private message. :P
@Shining-Armor: I thought as much. As far as I could read of the controllers, mainRoom should always be available, but for some reason, when I used it, nothing worked as it said "mainRoom is not defined". Any pointers?