diff --git a/modules/admin/commands.js b/modules/admin/commands.js index 0cba001..5ab67f9 100644 --- a/modules/admin/commands.js +++ b/modules/admin/commands.js @@ -149,6 +149,46 @@ var commands = function(dbot) { } else { event.reply(dbot.t('unban_error', {'user': username})); } + }, + + /*** Config options ***/ + + 'setconfig': function(event) { + var configKey = event.params[1]; + var newOption = event.params[2]; + + configKey = configKey.split('.'); + defaultConfigPath = dbot.config; + userConfigPath = dbot.db.config; + for(var i=0;i " + newOption); + userConfigPath[configItem] = newOption; + dbot.reloadModules(); } }; diff --git a/run.js b/run.js index 2faff6e..69fe227 100644 --- a/run.js +++ b/run.js @@ -162,7 +162,7 @@ DBot.prototype.reloadModules = function() { var config = {}; if(_.has(this.db.config, name)) { - config = this.db.config; + config = this.db.config[name]; } try {