From 79bbc034c46c5d10fedc34ff300a8e6556330aad Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Wed, 12 Oct 2011 18:09:55 +0100 Subject: [PATCH] modehate --- modules/admin.js | 4 ++++ modules/modehate.js | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 modules/modehate.js diff --git a/modules/admin.js b/modules/admin.js index 48c5c5b..f9d42f0 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -61,6 +61,10 @@ var adminCommands = function(dbot) { } else { dbot.say(data.channel, 'It appears ' + params[1] + 'wasn\'t banned from that command, you fool.'); } + }, + + 'modehate': function(data, params) { + dbot.db.modehate.push(params[2]); } }; diff --git a/modules/modehate.js b/modules/modehate.js new file mode 100644 index 0000000..9809d9e --- /dev/null +++ b/modules/modehate.js @@ -0,0 +1,17 @@ +var modehate = function(dbot) { + var dbot = dbot; + + return { + 'listener': function(data) { + if(dbot.db.modehate.include(data.user)) { + dbot.instance.send('KICK', data.channel, data.user, 'gtfo') + } + }, + + on: 'MODE' + }; +}; + +exports.fetch = function(dbot) { + return modehate(dbot); +};