Dectecting spam on a chat room

.net, c#, spam-prevention

Solution

In any event, you can only go so far before your efforts have little to no return vs effort of coding. What would probably be better is to to something like how stack overflow or world of warcraft work, where the users have more control. In WOW a player can click on someone's name in the chat box and simply report as spam(mer).

It wouldn't be to hard to say if some percentage of people who can see the message, report it, then most likely that person is spamming. You can then auto-decide or mark it for review, or however you want to deal with it. Since your problem is detecting spam, if users are going to see it (which they are) why not allow them to help alleviate the problem.

I think being honest with users and saying, we have a problem, we need your help, and making it easy for users to help shows a level of maturity.

Problem

Say someone starts spamming a chat with random characters. How would I determine in C# if the string is just random characters or them legitimately talking? - I've removed a few words I don't want them to say. - I've removed links/emails from chat. - I've stopped them from sending messages too fast. - I've stopped them from saying the same thing multiple times in a row. Number 4 is where the problem begins. Well the problem actually begins with me trying to filter a chat, but that's another discussion. They have now learned that it only checks if it's the same thing and now spam random characters. This is for a game that I only have control over the servers code.

Original source