Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created February 15, 2021 12:40
Show Gist options
  • Save AllGistsEqual/3cab2f122294044fa6cfd01ef7815c0f to your computer and use it in GitHub Desktop.
Save AllGistsEqual/3cab2f122294044fa6cfd01ef7815c0f to your computer and use it in GitHub Desktop.
// File: src/index.js
bot.loadConfig = function loadConfig(config, callback) {
bot.log.info(`Checking for config file...`)
const configExists = fs.existsSync(this.configFile)
/* [ALPHA]
* If the file does not exist, create it
*/
/* [BETA]
* Load the config file from the directory
*/
/* [GAMMA]
* iterate over the given config, check all values and sanitise
*/
/* [DELTA]
* write the changed/created config file to the directory
*/
/*
* read the new file from the directory again
* - assign it to the bot's config
* - execute callback() or abort on error
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment