diff --git a/modules/web.js b/modules/web.js index 9a26d79..c4aaf4f 100644 --- a/modules/web.js +++ b/modules/web.js @@ -12,7 +12,6 @@ var webInterface = function(dbot) { app.get('/', function(req, res) { res.render('index', { }); - console.log('test'); }); app.listen(1337); diff --git a/run.js b/run.js index 4a788ec..fe245a4 100644 --- a/run.js +++ b/run.js @@ -30,6 +30,12 @@ DBot.prototype.save = function() { }; DBot.prototype.reloadModules = function() { + this.modules.each(function(module) { + if(module.onDestroy) { + module.onDestroy(); + } + }); + this.rawModules = []; this.modules = []; this.commands = {}; @@ -39,12 +45,6 @@ DBot.prototype.reloadModules = function() { require.cache[path] = undefined; require('./snippets'); - this.modules.each(function(module) { - if(module.onDestroy) { - module.onDestroy(); - } - }); - this.moduleNames.each(function(name) { var cacheKey = require.resolve('./modules/' + name); require.cache[cacheKey] = undefined; // TODO: snippet to remove element properly