mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
merge [#307]
This commit is contained in:
commit
4891b70ec3
@ -16,5 +16,6 @@
|
||||
"moduleNames": [ "ignore", "admin", "command", "dice", "js", "kick", "quotes", "spelling", "youare", "timers", "stats", "users", "link" ],
|
||||
"language": "en",
|
||||
"debugMode": false,
|
||||
"debugLevel": 1,
|
||||
"version": "Depressionbot IRC bot 0.4-dev - Lovingly crafted by The DepressionBot Foundation (a charity arm of the Official Aberystwyth Open Source International Development League)."
|
||||
}
|
||||
|
@ -77,7 +77,6 @@ var commands = function(dbot) {
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
||||
'status': function(event) {
|
||||
var moduleName = event.params[1];
|
||||
if(_.has(dbot.status, moduleName)) {
|
||||
@ -162,8 +161,13 @@ var commands = function(dbot) {
|
||||
newOption = (newOption == "true");
|
||||
}
|
||||
|
||||
// Convert to integer type is config item integer
|
||||
if(_.isNumber(currentOption)) {
|
||||
newOption = parseInt(newOption);
|
||||
}
|
||||
|
||||
if(_.isArray(currentOption)) {
|
||||
event.reply(dbot.t("config_array",{"alternate": "pushconfig"}));
|
||||
event.reply(dbot.t("config_array", { "alternate": "pushconfig" }));
|
||||
}
|
||||
|
||||
event.reply(configPath + ": " + config + " -> " + newOption);
|
||||
|
@ -39,9 +39,15 @@ var command = function(dbot) {
|
||||
}
|
||||
} catch(err) {
|
||||
if(dbot.config.debugMode == true) {
|
||||
var stack = err.stack.split('\n').slice(1, dbot.config.debugLevel + 1);
|
||||
|
||||
event.reply('- Error in ' + commandName + ':');
|
||||
event.reply('- Message: ' + err);
|
||||
event.reply('- Top of stack: ' + err.stack.split('\n')[1].trim());
|
||||
|
||||
_.each(stack, function(stackLine, index) {
|
||||
event.reply('- Stack[' + index + ']: ' +
|
||||
stackLine.trim());
|
||||
});
|
||||
}
|
||||
}
|
||||
dbot.save();
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 86227ce8fca8e24f56a24cf50c1b4823ab1c5071
|
||||
Subproject commit 6e841d96df413a8039b15a53ef0c6b77630b552a
|
12
run.js
12
run.js
@ -295,7 +295,19 @@ DBot.prototype.reloadModules = function() {
|
||||
}
|
||||
|
||||
this.modules[module.name] = module;
|
||||
<<<<<<< HEAD
|
||||
}.bind(this));
|
||||
=======
|
||||
} catch(err) {
|
||||
console.log(this.t('module_load_error', { 'moduleName': name }));
|
||||
this.status[name] = err + ' - ' + err.stack.split('\n')[1].trim();
|
||||
if(this.config.debugMode) {
|
||||
console.log('MODULE ERROR (' + name + '): ' + err.stack );
|
||||
} else {
|
||||
console.log('MODULE ERROR (' + name + '): ' + err );
|
||||
}
|
||||
}
|
||||
>>>>>>> 2afb1c6ba37eb92f875124c754453bb063f42277
|
||||
}.bind(this));
|
||||
|
||||
process.nextTick(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user