I'm currently coding a bot for Twitch.
Now I want to check each message for special characters and detect messages that have more than 20% special characters.
The message itself is a variable var msg
and if the message should contain more than 20% special characters a command should be used to time out the user.
This is the event it should listen to:
event.on("chat", function(user, channel, message) {
var msg = message.toLowerCase();
var args = msg.split(" ");
console.log("<"+user.color+" | "+user.username+" | "+user.special+"> <"+channel+"> "+message)
});
Hope anyone can help me. It's my first, more or less, serious project in JavaScript.