Initial update to try and fix #1

This commit is contained in:
Logan Cusano
2023-03-26 15:03:35 -04:00
parent 403b533a33
commit b296da629b
14 changed files with 225 additions and 120 deletions

View File

@@ -0,0 +1,42 @@
// Debug
const { DebugBuilder } = require("../utilities/debugBuilder.js");
const log = new DebugBuilder("client-bot", "configController");
// Modules
const { readFileSync } = require('fs');
const path = require("path");
exports.getConfig = function getConfig() {
return JSON.parse(readFileSync(path.resolve("discord-bot/config/botConfig.json")));
}
exports.getGuildID = function getGuildID() {
const parsedJSON = getConfig();
const guildID = parsedJSON.GuildID;
log.DEBUG("Guild ID: ", guildID);
return guildID;
}
exports.getApplicationID = function getApplicationID() {
const parsedJSON = getConfig();
const appID = parsedJSON.ApplicationID;
log.DEBUG("Application ID: ", appID);
return appID;
}
exports.getDeviceID = function getDeviceID(){
const parsedJSON = getConfig();
const deviceID = parseInt(parsedJSON.DeviceID);
log.DEBUG("Device ID: ", deviceID);
return deviceID;
}
exports.getDeviceName = function getDeviceName(){
const parsedJSON = getConfig();
const deviceName = parsedJSON.DeviceName;
log.DEBUG("Device Name: ", deviceName);
return deviceName;
}