diff --git a/run.js b/run.js index ce62d0c..53e86ff 100644 --- a/run.js +++ b/run.js @@ -136,10 +136,7 @@ DBot.prototype.reloadModules = function() { this.modules = {}; this.commands = {}; this.api = {}; -<<<<<<< HEAD -======= this.stringMap = {}; ->>>>>>> 36d40f65a309f6911bae95bf0428d332c32a496a this.usage = {}; try { @@ -221,7 +218,6 @@ DBot.prototype.reloadModules = function() { } } -<<<<<<< HEAD process.nextTick(function() { _.each(moduleNames, function(name) { try { @@ -235,21 +231,6 @@ DBot.prototype.reloadModules = function() { console.log('Error loading module: ' + err + ' ' + stack); return; } -======= - // Load string data for the module - _.each([ 'usage', 'strings' ], function(property) { - var propertyData = {}; - try { - propertyData = JSON.parse(fs.readFileSync(moduleDir + property + '.json', 'utf-8')); - } catch(err) {}; - _.extend(this[property], propertyData); - if(property == 'strings') { - _.each(_.keys(propertyData), function(string) { - this.stringMap[string] = name; - }.bind(this)); - } - }, this); ->>>>>>> 36d40f65a309f6911bae95bf0428d332c32a496a module.name = name; module.db = this.ddb.databanks[name]; @@ -307,6 +288,11 @@ DBot.prototype.reloadModules = function() { propertyData = JSON.parse(fs.readFileSync(moduleDir + property + '.json', 'utf-8')); } catch(err) {}; _.extend(this[property], propertyData); + if(property == 'strings') { + _.each(_.keys(propertyData), function(string) { + this.stringMap[string] = name; + }.bind(this)); + } }, this); // Provide toString for module name