From 6a28327d5ca07f9e0edce86102e478a8f6bcec44 Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 18 Dec 2012 11:07:39 +0000 Subject: [PATCH] load config before the module itself --- run.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/run.js b/run.js index 8a1087d..e9e5132 100644 --- a/run.js +++ b/run.js @@ -150,6 +150,19 @@ DBot.prototype.reloadModules = function() { delete require.cache[cacheKey]; try { + // Load the module config data + try { + var config = JSON.parse(fs.readFileSync(moduleDir + 'config.json', 'utf-8')) + this.config[name] = config; + for(var i=0;i