From c1a63d331acd5c01ccf9bf117fca4d037f2a0917 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 30 Jun 2013 18:25:45 +0000 Subject: [PATCH] auto modules prefix in ~showconfig [#520] --- modules/admin/commands.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/admin/commands.js b/modules/admin/commands.js index db87f8f..252c234 100644 --- a/modules/admin/commands.js +++ b/modules/admin/commands.js @@ -244,8 +244,14 @@ var commands = function(dbot) { } } else { event.reply(dbot.t("no_config_key", {'path': configPath})); + configPath = configPath.split('.'); - configPath.pop(); + if(_.has(dbot.config.modules, configPath[0])) { + configPath.splice(0, 0, 'modules'); + } else { + configPath.pop(); + } + event.params[1] = configPath.join('.'); this.commands['~showconfig'](event); }