42 lines
1.1 KiB
JavaScript
42 lines
1.1 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");
|
|
|
|
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;
|
|
} |