replace missing config values from config template
This commit is contained in:
parent
ecb9004ec8
commit
a048d94cd0
1 changed files with 10 additions and 0 deletions
10
index.js
10
index.js
|
@ -21,12 +21,22 @@ const sentry = require('@sentry/node')
|
||||||
const client = new Discord.Client({ disabledEvents: ['TYPING_START'] })
|
const client = new Discord.Client({ disabledEvents: ['TYPING_START'] })
|
||||||
|
|
||||||
// Load all our useful utilities
|
// Load all our useful utilities
|
||||||
|
client.configTemplate = require('./configTemplate')
|
||||||
client.config = require('./config')
|
client.config = require('./config')
|
||||||
client.version = require('./version.json')
|
client.version = require('./version.json')
|
||||||
client.db = require('./utils/mongoose')
|
client.db = require('./utils/mongoose')
|
||||||
client.logger = require('./utils/logger')
|
client.logger = require('./utils/logger')
|
||||||
require('./utils/_functions')(client)
|
require('./utils/_functions')(client)
|
||||||
|
|
||||||
|
// Set missing values in config from config template
|
||||||
|
for(let c in client.configTemplate) {
|
||||||
|
if(typeof client.config[c] == 'undefined') {
|
||||||
|
client.logger.warn('Config value missing: ' + String(c))
|
||||||
|
|
||||||
|
client.config[c] = client.configTemplate[c]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof client.config.devmode !== 'undefined') { // Check if devmode is explicitly overridden
|
if (typeof client.config.devmode !== 'undefined') { // Check if devmode is explicitly overridden
|
||||||
client.devmode = client.config.devmode
|
client.devmode = client.config.devmode
|
||||||
} else { // Check if Woomy is running inside a Docker
|
} else { // Check if Woomy is running inside a Docker
|
||||||
|
|
Loading…
Reference in a new issue