diff --git a/modules/admin.js b/modules/admin.js index a8a14cd..70be12b 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -6,11 +6,11 @@ var adminCommands = function(dbot) { var commands = { 'join': function(data, params) { dbot.instance.join(params[1]); - dbot.say(dbot.admin, 'Joined ' + params[1]); + dbot.say(data.channel, 'Joined ' + params[1]); }, 'opme': function(data, params) { - dbot.instance.send('MODE ' + params[1] + ' +o ', dbot.admin); + dbot.instance.send('MODE ' + params[1] + ' +o ', data.user); }, 'part': function(data, params) { @@ -106,7 +106,7 @@ var adminCommands = function(dbot) { if(data.channel == dbot.name) data.channel = data.user; params = data.message.split(' '); - if(commands.hasOwnProperty(params[0]) && data.user == dbot.admin) { + if(commands.hasOwnProperty(params[0]) && dbot.admin.include(data.user)) { commands[params[0]](data, params); dbot.save(); } diff --git a/modules/drama.js b/modules/drama.js index c7d3daa..d68cca8 100644 --- a/modules/drama.js +++ b/modules/drama.js @@ -26,7 +26,7 @@ var drama = function(dbot) { var commands = { '~train': function(data, params) { - if(data.user == dbot.admin || data.user == 'golem' || data.user == 'Sam') { + if(dbot.admin.include(data.user)) { bayes.train(last[params[1]][params[2]], params[3]); dbot.say(data.channel, 'Last thing ' + params[2] + ' said in ' + params[1] + ' (' + last[params[1]][params[2]] + ') classified as \'' + params[3] + '\''); @@ -34,7 +34,7 @@ var drama = function(dbot) { }, '~rtrain': function(data, params) { - if(data.user == dbot.admin || data.user == 'golem' || data.user == 'Sam') { + if(dbot.admin.include(data.user)) { var category = params[1]; params.splice(0, 2); var msg = params.join(' '); diff --git a/modules/js.js b/modules/js.js index 9547c85..3a5ee5f 100644 --- a/modules/js.js +++ b/modules/js.js @@ -15,7 +15,7 @@ var js = function(dbot) { '~ajs': function(data, params) { var q = data.message.valMatch(/^~ajs (.*)/, 2); - if(data.user == dbot.admin) { + if(dbot.admin.include(data.user)) { dbot.say(data.channel, eval(q[1])); } } diff --git a/modules/puns.js b/modules/puns.js index 29b7ae9..8578129 100644 --- a/modules/puns.js +++ b/modules/puns.js @@ -7,9 +7,6 @@ var puns = function(dbot) { dbot.instance.say(data.channel, dbot.interpolatedQuote('realityonce')); } else if(dbot.db.quoteArrs.hasOwnProperty(data.user.toLowerCase())) { dbot.say(data.channel, data.user + ': ' + dbot.interpolatedQuote(data.user.toLowerCase())); - } else if(dbot.instance.inChannel(data.channel)) { - dbot.instance.say('aisbot', '.karma ' + data.user); - dbot.waitingForKarma = data.channel; } }, diff --git a/modules/quotes.js b/modules/quotes.js index 340adf2..912142e 100644 --- a/modules/quotes.js +++ b/modules/quotes.js @@ -65,13 +65,13 @@ var quotes = function(dbot) { }, '~rmlast': function(data, params) { - if(rmAllowed == true || data.user == dbot.admin) { + if(rmAllowed == true || dbot.admin.include(data.user)) { var q = data.message.valMatch(/^~rmlast ([\d\w\s-]*)/, 2); if(q) { q[1] = q[1].trim() key = q[1].toLowerCase(); if(quotes.hasOwnProperty(q[1])) { - if(!dbot.db.locks.include(q[1]) || data.user == dbot.admin) { + if(!dbot.db.locks.include(q[1]) || dbot.admin.include(data.user)) { var quote = quotes[key].pop(); if(quotes[key].length === 0) { delete quotes[key]; @@ -104,7 +104,7 @@ var quotes = function(dbot) { }, '~rm': function(data, params) { - if(rmAllowed == true || data.user == dbot.admin) { + if(rmAllowed == true || dbot.admin.include(data.user)) { var q = data.message.valMatch(/^~rm ([\d\w\s-]*) (.+)$/, 3); if(q) { if(quotes.hasOwnProperty(q[1])) { diff --git a/run.js b/run.js index 9f4a2eb..6fa1d1a 100644 --- a/run.js +++ b/run.js @@ -39,7 +39,7 @@ var DBot = function(timers) { // Populate bot properties with config data this.name = this.config.name || 'dbox'; - this.admin = this.config.admin || 'reality'; + this.admin = this.config.admin || [ 'reality' ]; this.password = this.config.password || 'lolturtles'; this.nickserv = this.config.nickserv || 'zippy'; this.server = this.config.server || 'elara.ivixor.net';