3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 22:39:26 +01:00

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 ignore = function(dbot) {
var commands = { var commands = {
'~ignore': function(event) { '~ignore': function(event) {
var ignorableModules = []; var ignorableModules = dbot.modules.filter(function(module) {
dbot.modules.each(function(module) {
if(module.ignorable != null && module.ignorable == true) { if(module.ignorable != null && module.ignorable == true) {
ignorableModules.push(module.name); return true;
} }
}); });
var module = event.params[1]; var module = event.params[1];

3
run.js
View File

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