fix broken declarations

This commit is contained in:
Bryson Steck 2022-03-11 17:53:55 -07:00
parent 60886d7010
commit 0ab741be03

View file

@ -1,6 +1,8 @@
const tmi = require('tmi.js'); const tmi = require('tmi.js');
const fs = require('fs'); const fs = require('fs');
var settings, reacts, commands, mod_commands;
// read settings and reactions json files // read settings and reactions json files
fs.readFile('./settings.json', 'utf8', (err, data) => { fs.readFile('./settings.json', 'utf8', (err, data) => {
if (err) { if (err) {
@ -8,7 +10,7 @@ fs.readFile('./settings.json', 'utf8', (err, data) => {
process.exit(1); process.exit(1);
} else { } else {
// parse JSON string to JSON object // parse JSON string to JSON object
const settings = JSON.parse(data); settings = JSON.parse(data);
} }
}); });
@ -18,7 +20,7 @@ fs.readFile('./reacts.json', 'utf8', (err, data) => {
process.exit(1); process.exit(1);
} else { } else {
// parse JSON string to JSON object // parse JSON string to JSON object
const reacts = JSON.parse(data); reacts = JSON.parse(data);
} }
}); });
@ -28,7 +30,7 @@ fs.readFile('./commands.json', 'utf8', (err, data) => {
process.exit(1); process.exit(1);
} else { } else {
// parse JSON string to JSON object // parse JSON string to JSON object
const commands = JSON.parse(data); commands = JSON.parse(data);
} }
}); });
@ -38,7 +40,7 @@ fs.readFile('./mod_commands.json', 'utf8', (err, data) => {
process.exit(1); process.exit(1);
} else { } else {
// parse JSON string to JSON object // parse JSON string to JSON object
const mod_commands = JSON.parse(data); mod_commands = JSON.parse(data);
} }
}); });