From c9504a1db35dc160a3ab0d3a47c2a230b33caf25 Mon Sep 17 00:00:00 2001 From: Alee14 Date: Wed, 31 May 2017 18:54:22 -0400 Subject: Update aleemod.js --- aleemod.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'aleemod.js') diff --git a/aleemod.js b/aleemod.js index e059bd9..efea3b5 100644 --- a/aleemod.js +++ b/aleemod.js @@ -70,7 +70,36 @@ const Discord = require('discord.js'); return; } } - + + //No Caps + if (msg.match(/[A-Z]/gm) != null && msg.match(/[A-Z]/gm).length > (parseFloat(msg.length) * 0.8)) { + console.log("[FILTER] Caps caught from " + getUserString(message.author)); + switch (Math.floor(Math.random() * 1000) % 6) { + case 0: + message.reply("Shh..."); + break; + case 1: + message.reply("The community likes peace and quiet."); + break; + case 2: + message.reply("Isn't it weird when you're reading... and then you see a bunch of caps?"); + break; + case 3: + message.reply("If you're going to type that, why not get out a pen and paper and do it yourself or shout in your head please!"); + break; + case 4: + message.reply("DON'T SHOUT IN HERE K THIS IS ME :angry:"); + break; + case 5: + message.reply("Whoa whoa, slow down, my friend! No need for raised voices!"); + break; + } + message.delete(); + return; + } + } + } + //Spam limiting if (lastMessages[message.author.id] != msg) { -- cgit v1.2.3