ignorableModules now built with filter, module.toString returns name

This commit is contained in:
reality 2012-12-30 17:52:42 +00:00
parent 85fc4d6e6f
commit 078c4cf3e3
2 changed files with 5 additions and 4 deletions

View File

@ -7,11 +7,9 @@
var ignore = function(dbot) {
var commands = {
'~ignore': function(event) {
var ignorableModules = [];
dbot.modules.each(function(module) {
var ignorableModules = dbot.modules.filter(function(module) {
if(module.ignorable != null && module.ignorable == true) {
ignorableModules.push(module.name);
return true;
}
});
var module = event.params[1];

3
run.js
View File

@ -226,6 +226,9 @@ DBot.prototype.reloadModules = function() {
// Invalid or no string info
}
module.toString = function() {
return this.name;
}
this.modules[module.name] = module;
} catch(err) {
console.log(this.t('module_load_error', {'moduleName': name}));