From beaa4200155b78c5bb0742f7b13b126de7423371 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 16 Feb 2018 14:36:56 +0000 Subject: [PATCH] i am not very smart --- modules/kill_namespam/kill_namespam.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/kill_namespam/kill_namespam.js b/modules/kill_namespam/kill_namespam.js index a0190d1..5eddb17 100644 --- a/modules/kill_namespam/kill_namespam.js +++ b/modules/kill_namespam/kill_namespam.js @@ -12,6 +12,7 @@ var kill_namespam = function(dbot) { if(_.includes(this.config.exempt, event.user)) return; var message; + var naughty = false; // Check distinctive spam content match if(_.any(this.config.advert_content, function(spam) { return event.message.indexOf(spam) != -1; })) { @@ -49,6 +50,22 @@ var kill_namespam = function(dbot) { } }.bind(this); this.on = 'PRIVMSG'; + + this.commands = { + '~add_spamkill': function(event) { + this.config.advert_content.push(event.params.slice(1).join(' ')) + event.reply('Users daring to utter the above to be classified as spam.'); + }, + + '~del_spamkill': function(event) { + this.config.advert_content = _.without(this.config.advert_content, event.params.slice(1).join(' ')); + event.reply('Users will no longer be killed for this utterance.'); + } + }; + + _.each(this.commands, function(c) { + c.access = 'moderator'; + }); }; exports.fetch = function(dbot) {