forked from GitHub/dbot
savemodules command [#438]
This commit is contained in:
parent
e8537a93b2
commit
0259584c25
@ -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) {
|
||||
|
@ -125,5 +125,8 @@
|
||||
},
|
||||
"config_keys_location": {
|
||||
"en": "Config keys in {path}: {value}"
|
||||
},
|
||||
"modules_saved": {
|
||||
"en": "Currently loaded modules now default: {modules}"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user