From 79f42166ddea75d77d476687fedca31d3c930188 Mon Sep 17 00:00:00 2001 From: chris062689 Date: Sun, 29 Jul 2018 18:47:19 -0400 Subject: [PATCH] Updating responses.json loading. --- src/data.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/data.js b/src/data.js index 820b526..df580c6 100644 --- a/src/data.js +++ b/src/data.js @@ -32,16 +32,8 @@ function readBans() { function readCustomResponses() { // Load the responses file into the responses variable. - var readFilePath = `./responses/${process.env.TENANT}.json`; - fs.readFile(readFilePath, 'utf8', function (err, data) { - if (err) { throw err; } - if (data) { - state.responses = JSON.parse(data); - logger.debug(`Loaded responses file for ${process.env.TENANT} from external source.`); - } else { - logger.warn(`${readFilePath} appears to be an empty file.`); - } - }); + state.responses = require(`./${process.env.TENANT}.json`); + logger.debug(`Loaded responses file for ${process.env.TENANT} from external source.`); } function flushWarnings() {