diff --git a/modules/admin/commands.js b/modules/admin/commands.js index e5954ee..66bdb63 100644 --- a/modules/admin/commands.js +++ b/modules/admin/commands.js @@ -184,18 +184,14 @@ var commands = function(dbot) { if(_.isArray(config)) { event.reply(dbot.t("config_array", { "alternate": "pushconfig" })); } - - event.reply(configPath + ": " + config + " -> " + newOption); - config = newOption; - this.db.save('config', configPath, { - 'key': configPath, - 'value': config - }, function(err) { - dbot.reloadModules(); - }); } else { - event.reply(dbot.t("no_config_key", {'path': configPath})); + event.reply(dbot.t('new_config_key', { 'key': configPath })); + config = null; } + + this.internalAPI.setConfig(configPath, newOption, function(err) { + event.reply(configPath + ": " + config + " -> " + newOption); + }); }.bind(this)); } else { event.reply(dbot.t("config_lock")); diff --git a/modules/admin/strings.json b/modules/admin/strings.json index 1099d4e..1c117cf 100644 --- a/modules/admin/strings.json +++ b/modules/admin/strings.json @@ -160,6 +160,9 @@ "cy": "Nid yw llwybr cyfluniad yn bodoli, fy mrawd", "de": "Konfigurationspfad nicht vorhanden, Bruder" }, + "new_config_key": { + "en": "Warning: Creating new config key: {key}." + }, "config_keys_location": { "en": "Config keys in {path}: {value}", "cy": "Allweddi cyfluniad yn {path}: {value}",