mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 03:33:07 +01:00
reload default strings in updateModules
This commit is contained in:
parent
b641dcd34a
commit
19c3497f11
@ -53,7 +53,6 @@ var admin = function(dbot) {
|
||||
// Reload DB, translations and modules.
|
||||
'reload': function(event) {
|
||||
dbot.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
|
||||
dbot.strings = JSON.parse(fs.readFileSync('strings.json', 'utf-8'));
|
||||
dbot.reloadModules();
|
||||
event.reply(dbot.t('reload'));
|
||||
},
|
||||
|
7
run.js
7
run.js
@ -151,11 +151,16 @@ DBot.prototype.reloadModules = function() {
|
||||
this.modules = [];
|
||||
this.commands = {};
|
||||
this.commandMap = {}; // Map of which commands belong to which modules
|
||||
this.strings = {};
|
||||
this.usage = {};
|
||||
this.timers.clearTimers();
|
||||
this.save();
|
||||
|
||||
try {
|
||||
this.strings = JSON.parse(fs.readFileSync('strings.json', 'utf-8'));
|
||||
} catch(err) {
|
||||
this.strings = {};
|
||||
}
|
||||
|
||||
// Enforce having command. it can still be reloaded, but dbot _will not_
|
||||
// function without it, so not having it should be impossible
|
||||
if(!this.moduleNames.include("command")) {
|
||||
|
Loading…
Reference in New Issue
Block a user