mirror of
https://github.com/reality/dbot.git
synced 2025-01-12 21:22: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.commandMap = {}; // Map of which commands belong to which modules
|
||||||
this.usage = {};
|
this.usage = {};
|
||||||
this.timers.clearTimers();
|
this.timers.clearTimers();
|
||||||
this.save();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.strings = JSON.parse(fs.readFileSync('strings.json', 'utf-8'));
|
this.strings = JSON.parse(fs.readFileSync('strings.json', 'utf-8'));
|
||||||
@ -211,7 +210,7 @@ DBot.prototype.reloadModules = function() {
|
|||||||
try {
|
try {
|
||||||
var config = JSON.parse(fs.readFileSync(moduleDir + 'config.json', 'utf-8'))
|
var config = JSON.parse(fs.readFileSync(moduleDir + 'config.json', 'utf-8'))
|
||||||
this.config[name] = config;
|
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])) {
|
if(!this.db.hasOwnProperty(config.dbKeys[i])) {
|
||||||
this.db[config.dbKeys[i]] = {};
|
this.db[config.dbKeys[i]] = {};
|
||||||
}
|
}
|
||||||
@ -226,6 +225,7 @@ DBot.prototype.reloadModules = function() {
|
|||||||
console.log('MODULE ERROR: ' + name + ' ' + err);
|
console.log('MODULE ERROR: ' + name + ' ' + err);
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
this.save();
|
||||||
};
|
};
|
||||||
|
|
||||||
DBot.prototype.cleanNick = function(key) {
|
DBot.prototype.cleanNick = function(key) {
|
||||||
|
Loading…
Reference in New Issue
Block a user