mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 04:02:39 +01:00
Merge pull request #69 from SamStudio8/patch-1
Fixed module loading and dbKeys bug. A+ Merged.
This commit is contained in:
commit
e970ab579c
3
modules/ignore/config.json
Normal file
3
modules/ignore/config.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"dbKeys": [ "ignores" ]
|
||||
}
|
4
run.js
4
run.js
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user