47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
// Debug
|
|
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
|
const log = new DebugBuilder("client-bot", "configController");
|
|
// Modules
|
|
const { readFileSync } = require('fs');
|
|
const path = require("path");
|
|
|
|
function getConfig() {
|
|
return JSON.parse(readFileSync(path.resolve("discord-bot/config/botConfig.json")));
|
|
}
|
|
exports.getConfig = getConfig;
|
|
|
|
function getGuildID() {
|
|
const parsedJSON = getConfig();
|
|
const guildID = parsedJSON.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;
|
|
}
|
|
exports.getApplicationID = getApplicationID;
|
|
|
|
function getDeviceID(){
|
|
const parsedJSON = getConfig();
|
|
const deviceID = parseInt(parsedJSON.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;
|
|
}
|
|
exports.getDeviceName = getDeviceID; |