3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 03:33:07 +01:00

savemodules command [#438]

This commit is contained in:
reality 2013-05-10 18:12:40 +00:00
parent e8537a93b2
commit 0259584c25
2 changed files with 14 additions and 1 deletions

View File

@ -258,7 +258,17 @@ var commands = function(dbot) {
"value": _.keys(dbot.config)
}));
}
}
},
'savemodules': function(event) {
fs.readFile('config.json', 'utf-8', function(err, config) {
config = JSON.parse(config);
config.moduleNames = _.keys(dbot.modules);
fs.writeFile('config.json', JSON.stringify(config, null, ' '), function() {
event.reply(dbot.t('modules_saved', { 'modules': _.keys(dbot.modules) }));
});
});
}
};
_.each(commands, function(command) {

View File

@ -125,5 +125,8 @@
},
"config_keys_location": {
"en": "Config keys in {path}: {value}"
},
"modules_saved": {
"en": "Currently loaded modules now default: {modules}"
}
}