Changing method of exporting to use functions locally
This commit is contained in:
@@ -5,38 +5,43 @@ const log = new DebugBuilder("client-bot", "configController");
|
|||||||
const { readFileSync } = require('fs');
|
const { readFileSync } = require('fs');
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
exports.getConfig = function getConfig() {
|
function getConfig() {
|
||||||
return JSON.parse(readFileSync(path.resolve("discord-bot/config/botConfig.json")));
|
return JSON.parse(readFileSync(path.resolve("discord-bot/config/botConfig.json")));
|
||||||
}
|
}
|
||||||
|
exports.getConfig = getConfig;
|
||||||
|
|
||||||
exports.getGuildID = function getGuildID() {
|
function getGuildID() {
|
||||||
const parsedJSON = this.getConfig();
|
const parsedJSON = getConfig();
|
||||||
const guildID = parsedJSON.GuildID;
|
const guildID = parsedJSON.GuildID;
|
||||||
|
|
||||||
log.DEBUG("Guild ID: ", guildID);
|
log.DEBUG("Guild ID: ", guildID);
|
||||||
return guildID;
|
return guildID;
|
||||||
}
|
}
|
||||||
|
exports.getGuildID = getGuildID;
|
||||||
|
|
||||||
exports.getApplicationID = function getApplicationID() {
|
function getApplicationID() {
|
||||||
const parsedJSON = this.getConfig();
|
const parsedJSON = getConfig();
|
||||||
const appID = parsedJSON.ApplicationID;
|
const appID = parsedJSON.ApplicationID;
|
||||||
|
|
||||||
log.DEBUG("Application ID: ", appID);
|
log.DEBUG("Application ID: ", appID);
|
||||||
return appID;
|
return appID;
|
||||||
}
|
}
|
||||||
|
exports.getApplicationID = getApplicationID;
|
||||||
|
|
||||||
exports.getDeviceID = function getDeviceID(){
|
function getDeviceID(){
|
||||||
const parsedJSON = this.getConfig();
|
const parsedJSON = getConfig();
|
||||||
const deviceID = parseInt(parsedJSON.DeviceID);
|
const deviceID = parseInt(parsedJSON.DeviceID);
|
||||||
|
|
||||||
log.DEBUG("Device ID: ", deviceID);
|
log.DEBUG("Device ID: ", deviceID);
|
||||||
return deviceID;
|
return deviceID;
|
||||||
}
|
}
|
||||||
|
exports.getDeviceID = getDeviceID;
|
||||||
|
|
||||||
exports.getDeviceName = function getDeviceName(){
|
function getDeviceName(){
|
||||||
const parsedJSON = this.getConfig();
|
const parsedJSON = getConfig();
|
||||||
const deviceName = parsedJSON.DeviceName;
|
const deviceName = parsedJSON.DeviceName;
|
||||||
|
|
||||||
log.DEBUG("Device Name: ", deviceName);
|
log.DEBUG("Device Name: ", deviceName);
|
||||||
return deviceName;
|
return deviceName;
|
||||||
}
|
}
|
||||||
|
exports.getDeviceName = getDeviceID;
|
||||||
Reference in New Issue
Block a user