From 0062dde196283e0614f0077d84b75b5885ea67be Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Sun, 15 Apr 2012 21:43:02 +0100 Subject: [PATCH] Command map changed round the other way. Modules have name and ignorable properties. Ignore and unignore commands, which currently effect actual commands but not listeners yet. --- modules/admin.js | 6 +++- modules/autoshorten.js | 6 +++- modules/command.js | 80 +++++++++++++++++++++++++++++++++++++++--- modules/dice.js | 6 +++- modules/drama.js | 6 +++- modules/js.js | 6 +++- modules/kick.js | 5 ++- modules/modehate.js | 6 +++- modules/puns.js | 6 +++- modules/quotes.js | 6 +++- modules/spelling.js | 6 +++- modules/web.js | 6 +++- modules/youare.js | 6 +++- run.js | 5 ++- 14 files changed, 137 insertions(+), 19 deletions(-) diff --git a/modules/admin.js b/modules/admin.js index d20a488..7c5962f 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -134,7 +134,11 @@ var adminCommands = function(dbot) { } }, - 'on': 'PRIVMSG' + 'on': 'PRIVMSG', + + 'name': 'admin', + + 'ignorable': false }; }; diff --git a/modules/autoshorten.js b/modules/autoshorten.js index 3f5c92a..eb0cf7c 100644 --- a/modules/autoshorten.js +++ b/modules/autoshorten.js @@ -27,7 +27,11 @@ var autoshorten = function(dbot) { } }, - 'on': 'PRIVMSG' + 'on': 'PRIVMSG', + + 'name': 'autoshorten', + + 'ignorable': true }; } diff --git a/modules/command.js b/modules/command.js index fcbb291..55b3168 100644 --- a/modules/command.js +++ b/modules/command.js @@ -6,7 +6,69 @@ var command = function(dbot) { return { 'onLoad': function() { return { - '~ignore': null + '~ignore': function(data, params) { + var ignorableModules = []; + for(var i=0;i