forked from GitHub/dbot
setconfig working + msg if new key is being created [#489]
This commit is contained in:
parent
546ce64707
commit
815d7a39cd
@ -184,18 +184,14 @@ var commands = function(dbot) {
|
|||||||
if(_.isArray(config)) {
|
if(_.isArray(config)) {
|
||||||
event.reply(dbot.t("config_array", { "alternate": "pushconfig" }));
|
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 {
|
} 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));
|
}.bind(this));
|
||||||
} else {
|
} else {
|
||||||
event.reply(dbot.t("config_lock"));
|
event.reply(dbot.t("config_lock"));
|
||||||
|
@ -160,6 +160,9 @@
|
|||||||
"cy": "Nid yw llwybr cyfluniad yn bodoli, fy mrawd",
|
"cy": "Nid yw llwybr cyfluniad yn bodoli, fy mrawd",
|
||||||
"de": "Konfigurationspfad nicht vorhanden, Bruder"
|
"de": "Konfigurationspfad nicht vorhanden, Bruder"
|
||||||
},
|
},
|
||||||
|
"new_config_key": {
|
||||||
|
"en": "Warning: Creating new config key: {key}."
|
||||||
|
},
|
||||||
"config_keys_location": {
|
"config_keys_location": {
|
||||||
"en": "Config keys in {path}: {value}",
|
"en": "Config keys in {path}: {value}",
|
||||||
"cy": "Allweddi cyfluniad yn {path}: {value}",
|
"cy": "Allweddi cyfluniad yn {path}: {value}",
|
||||||
|
Loading…
Reference in New Issue
Block a user