如何检测人类打字并防止在聊天网站上发送垃圾邮件

We have a chatting website and we disabled the Copy-Paste function to prevent spammers. But now they have found a new way to use auto typing software to spam. Is there any way to detect human typing or anything like that to stop them from spamming?

Detecting a robot versus a human typing would be a wasted effort of computing power. Perhaps to use the website you should use a captcha to determine if they are a robot. I would issue another captcha if they are:

  1. sending messages too frequently
  2. connecting with other patrons too frequently

This is what other popular chat websites do. Another way is to detect what their last message was, and not display it if it is the same as the last one.

You can use a CAPTCHA to do this. A CAPTCHA is a type of test used to determine whether or not the user is human. There are various providers of this service which would allow you to avoid building on yourself. For example: