From 815d7a39cdc52c0c902ce95480d32d0195960b77 Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 5 Jun 2013 21:52:14 +0000 Subject: [PATCH] setconfig working + msg if new key is being created [#489] --- modules/admin/commands.js | 16 ++++++---------- modules/admin/strings.json | 3 +++ 2 files changed, 9 insertions(+), 10 deletions(-) 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}",