fix undefined issue

This commit is contained in:
Bryson Steck 2022-03-11 17:59:00 -07:00
parent 0ab741be03
commit ab29cd51d1

View file

@ -4,7 +4,7 @@ const fs = require('fs');
var settings, reacts, commands, mod_commands; 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.readFileSync('./settings.json', 'utf8', (err, data) => {
if (err) { if (err) {
console.log(`Error reading settings file from disk: ${err}`); console.log(`Error reading settings file from disk: ${err}`);
process.exit(1); process.exit(1);
@ -14,7 +14,7 @@ fs.readFile('./settings.json', 'utf8', (err, data) => {
} }
}); });
fs.readFile('./reacts.json', 'utf8', (err, data) => { fs.readFileSync('./reacts.json', 'utf8', (err, data) => {
if (err) { if (err) {
console.log(`Error reading reacts file from disk: ${err}`); console.log(`Error reading reacts file from disk: ${err}`);
process.exit(1); process.exit(1);
@ -24,7 +24,7 @@ fs.readFile('./reacts.json', 'utf8', (err, data) => {
} }
}); });
fs.readFile('./commands.json', 'utf8', (err, data) => { fs.readFileSync('./commands.json', 'utf8', (err, data) => {
if (err) { if (err) {
console.log(`Error reading commands file from disk: ${err}`); console.log(`Error reading commands file from disk: ${err}`);
process.exit(1); process.exit(1);
@ -34,7 +34,7 @@ fs.readFile('./commands.json', 'utf8', (err, data) => {
} }
}); });
fs.readFile('./mod_commands.json', 'utf8', (err, data) => { fs.readFileSync('./mod_commands.json', 'utf8', (err, data) => {
if (err) { if (err) {
console.log(`Error reading mod commands file from disk: ${err}`); console.log(`Error reading mod commands file from disk: ${err}`);
process.exit(1); process.exit(1);