Revert to Naudiodon and Update Config

- Changed to .env file
This commit is contained in:
Logan Cusano
2023-04-30 03:52:20 -04:00
parent b248e7f40e
commit 95c99971a2
7 changed files with 2601 additions and 49 deletions

View File

@@ -4,45 +4,33 @@ const log = new DebugBuilder("client", "configController");
// Modules
const { readFileSync } = require('fs');
const path = require("path");
require('dotenv').config();
function getConfig() {
const botConfigObj = JSON.parse(readFileSync(path.resolve("./config/botConfig.json")))
return botConfigObj;
}
exports.getConfig = getConfig;
const GuildID = process.env.GUILD_ID;
const ApplicationID = process.env.APPLICATION_ID;
const DeviceID = parseInt(process.env.AUDIO_DEVICE_ID);
const DeviceName = process.env.AUDIO_DEVICE_NAME;
function getGuildID() {
const parsedJSON = getConfig();
const guildID = parsedJSON.GuildID;
log.DEBUG("Guild ID: ", guildID);
return guildID;
log.DEBUG("Guild ID: ", GuildID);
return GuildID;
}
exports.getGuildID = getGuildID;
function getApplicationID() {
const parsedJSON = getConfig();
const appID = parsedJSON.ApplicationID;
log.DEBUG("Application ID: ", appID);
return appID;
log.DEBUG("Application ID: ", ApplicationID);
return ApplicationID;
}
exports.getApplicationID = getApplicationID;
function getDeviceID(){
const parsedJSON = getConfig();
const deviceID = parseInt(parsedJSON.DeviceID);
log.DEBUG("Device ID: ", deviceID);
return deviceID;
log.DEBUG("Device ID: ", DeviceID);
return DeviceID;
}
exports.getDeviceID = getDeviceID;
function getDeviceName(){
const parsedJSON = getConfig();
const deviceName = parsedJSON.DeviceName;
log.DEBUG("Device Name: ", deviceName);
return deviceName;
log.DEBUG("Device Name: ", DeviceName);
return DeviceName;
}
exports.getDeviceName = getDeviceID;