3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 11:42:36 +01:00

Merge pull request #69 from SamStudio8/patch-1

Fixed module loading and dbKeys bug. A+ Merged.
This commit is contained in:
Luke Slater 2012-12-18 01:25:42 -08:00
commit e970ab579c
2 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1,3 @@
{
"dbKeys": [ "ignores" ]
}

4
run.js
View File

@ -122,7 +122,6 @@ DBot.prototype.reloadModules = function() {
this.commandMap = {}; // Map of which commands belong to which modules
this.usage = {};
this.timers.clearTimers();
this.save();
try {
this.strings = JSON.parse(fs.readFileSync('strings.json', 'utf-8'));
@ -211,7 +210,7 @@ DBot.prototype.reloadModules = function() {
try {
var config = JSON.parse(fs.readFileSync(moduleDir + 'config.json', 'utf-8'))
this.config[name] = config;
for(var i=0;i<config.dbKeys;i++) {
for(var i=0;i<config.dbKeys.length;i++) {
if(!this.db.hasOwnProperty(config.dbKeys[i])) {
this.db[config.dbKeys[i]] = {};
}
@ -226,6 +225,7 @@ DBot.prototype.reloadModules = function() {
console.log('MODULE ERROR: ' + name + ' ' + err);
}
}.bind(this));
this.save();
};
DBot.prototype.cleanNick = function(key) {