mirror of
https://github.com/reality/dbot.git
synced 2024-11-24 04:49:25 +01:00
comment formatting
This commit is contained in:
parent
12e62df846
commit
653264e46a
9
run.js
9
run.js
@ -11,13 +11,13 @@ var DBot = function(timers) {
|
|||||||
try {
|
try {
|
||||||
var rawDB = fs.readFileSync('db.json', 'utf-8');
|
var rawDB = fs.readFileSync('db.json', 'utf-8');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.db = {}; /* if no db file, make empty one */
|
this.db = {}; // If no db file, make empty one
|
||||||
}
|
}
|
||||||
if(!this.db) { /* if it wasn't empty */
|
if(!this.db) { // If it wasn't empty
|
||||||
this.db = JSON.parse(rawDB);
|
this.db = JSON.parse(rawDB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* repair any deficiencies in the DB; if this is a new DB, that's everything */
|
// Repair any deficiencies in the DB; if this is a new DB, that's everything
|
||||||
if(!this.db.hasOwnProperty("bans")) {
|
if(!this.db.hasOwnProperty("bans")) {
|
||||||
this.db.bans = {};
|
this.db.bans = {};
|
||||||
}
|
}
|
||||||
@ -96,7 +96,8 @@ DBot.prototype.reloadModules = function() {
|
|||||||
this.timers.clearTimers();
|
this.timers.clearTimers();
|
||||||
this.save();
|
this.save();
|
||||||
|
|
||||||
// enforce having command. it can still be reloaded, but dbot _will not_ function without it, so not having it should be impossible
|
// 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")) {
|
if(!this.moduleNames.include("command")) {
|
||||||
this.moduleNames.push("command");
|
this.moduleNames.push("command");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user