From f3b47558218135c165d9d8c87d21804ab9e6c5af Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Sun, 9 Jun 2024 10:03:23 +0300 Subject: [PATCH] Very strange stuff tbh --- app.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app.js b/app.js index 28aa808..9a3dd18 100644 --- a/app.js +++ b/app.js @@ -97,7 +97,7 @@ async function initialize() { const configExists = fs.existsSync("./config.json"); if (configExists) { - await readConfigFromFile("./config.json"); + config = JSON.parse(fs.readFileSync("./config.json", 'utf8')); console.log("Read config from file:", config) config.rooms.forEach(room => { addRoomToList(room); @@ -429,12 +429,4 @@ function writeConfigToFile(filePath) { }); } -async function readConfigFromFile(filePath) { - await fs.readFile(filePath, 'utf8', (err, data) => { - if(err) return console.log("Error while reading config.json! ", err) - data = JSON.parse(data); - config = data; - }); -} - initialize();