mirror of
https://github.com/reality/dbot.git
synced 2024-11-23 20:39:25 +01:00
thing
This commit is contained in:
parent
e1b15b7376
commit
9379b73bdf
10
run.js
10
run.js
@ -242,8 +242,6 @@ DBot.prototype.reloadModules = function() {
|
|||||||
if(propertyKey) delete require.cache[propertyKey];
|
if(propertyKey) delete require.cache[propertyKey];
|
||||||
propertyObj = require(moduleDir + property).fetch(this);
|
propertyObj = require(moduleDir + property).fetch(this);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
this.status[name] = 'Error loading ' + propertyKey +
|
|
||||||
': ' + err + ' - ' + err.stack.split('\n')[1].trim();
|
|
||||||
console.log('Module error (' + module.name + ') in ' +
|
console.log('Module error (' + module.name + ') in ' +
|
||||||
property + ': ' + err);
|
property + ': ' + err);
|
||||||
}
|
}
|
||||||
@ -282,7 +280,13 @@ DBot.prototype.reloadModules = function() {
|
|||||||
var propertyData = {};
|
var propertyData = {};
|
||||||
try {
|
try {
|
||||||
propertyData = JSON.parse(fs.readFileSync(moduleDir + property + '.json', 'utf-8'));
|
propertyData = JSON.parse(fs.readFileSync(moduleDir + property + '.json', 'utf-8'));
|
||||||
} catch(err) {};
|
} catch(err) {
|
||||||
|
this.status[name] = 'Error loading ' + property +
|
||||||
|
': ' + err + ' - ' + err.stack.split('\n')[1].trim();
|
||||||
|
console.log('Data error (' + module.name + ') in ' +
|
||||||
|
property + ': ' + err);
|
||||||
|
|
||||||
|
};
|
||||||
_.extend(this[property], propertyData);
|
_.extend(this[property], propertyData);
|
||||||
if(property == 'strings') {
|
if(property == 'strings') {
|
||||||
_.each(_.keys(propertyData), function(string) {
|
_.each(_.keys(propertyData), function(string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user