From d266f71c0e3ef41b64ffb68925213f14ee22c4f6 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Mon, 22 Aug 2011 22:17:13 +0100 Subject: [PATCH] Moved modules to a subdirectory. --- admin.js => modules/admin.js | 2 +- karma.js => modules/karma.js | 0 kick.js => modules/kick.js | 0 puns.js => modules/puns.js | 0 quotes.js => modules/quotes.js | 0 reality.js => modules/reality.js | 0 user.js => modules/user.js | 2 +- run.js | 14 +++++++------- 8 files changed, 9 insertions(+), 9 deletions(-) rename admin.js => modules/admin.js (96%) rename karma.js => modules/karma.js (100%) rename kick.js => modules/kick.js (100%) rename puns.js => modules/puns.js (100%) rename quotes.js => modules/quotes.js (100%) rename reality.js => modules/reality.js (100%) rename user.js => modules/user.js (97%) diff --git a/admin.js b/modules/admin.js similarity index 96% rename from admin.js rename to modules/admin.js index 48a7379..16472f9 100644 --- a/admin.js +++ b/modules/admin.js @@ -3,7 +3,7 @@ var adminCommands = function(dbot) { var commands = { 'join': function(data, params) { - dbot.join(params[1]); + dbot.instance.join(params[1]); dbot.say(dbot.admin, 'Joined ' + params[1]); }, diff --git a/karma.js b/modules/karma.js similarity index 100% rename from karma.js rename to modules/karma.js diff --git a/kick.js b/modules/kick.js similarity index 100% rename from kick.js rename to modules/kick.js diff --git a/puns.js b/modules/puns.js similarity index 100% rename from puns.js rename to modules/puns.js diff --git a/quotes.js b/modules/quotes.js similarity index 100% rename from quotes.js rename to modules/quotes.js diff --git a/reality.js b/modules/reality.js similarity index 100% rename from reality.js rename to modules/reality.js diff --git a/user.js b/modules/user.js similarity index 97% rename from user.js rename to modules/user.js index 0ac9bdb..832a231 100644 --- a/user.js +++ b/modules/user.js @@ -51,7 +51,7 @@ var userCommands = function(dbot) { }, '~kickcount': function(data, params) { - if(dbot.db.kicks[params[1]] == undefined) { + if(dbot.db.kicks.hasOwnProperty(params[1])) { dbot.say(data.channel, params[1] + ' has either never been kicked or does not exist.'); } else { dbot.say(data.channel, params[1] + ' has been kicked ' + dbot.db.kicks[params[1]] + ' times.'); diff --git a/run.js b/run.js index 71815e3..349af67 100644 --- a/run.js +++ b/run.js @@ -1,13 +1,13 @@ require('./snippets'); var fs = require('fs'); var jsbot = require('./jsbot'); -var quote = require('./quotes'); -var userCommands = require('./user'); -var adminCommands = require('./admin'); -var puns = require('./puns'); -var kick = require('./kick'); -var reality = require('./reality'); -var karma = require('./karma'); +var quote = require('./modules/quotes'); +var userCommands = require('./modules/user'); +var adminCommands = require('./modules/admin'); +var puns = require('./modules/puns'); +var kick = require('./modules/kick'); +var reality = require('./modules/reality'); +var karma = require('./modules/karma'); var dbot = Class.create({ initialize: function(dModules, quotes) {