Allow the client to interact with the discord bot

- The client can now interact with the bot, this allows the client to offer bot controls via API
- The master server will now be able to instruct a specific client to join a specific channel via channel ID (master server function coming soon)
- Suppress some debug statements to make the output easier to read when mixed in with the client debug output
This commit is contained in:
Logan Cusano
2022-12-18 20:31:54 -05:00
parent 6756a5e632
commit c8c75e8b37
9 changed files with 236 additions and 34 deletions

View File

@@ -1,10 +1,12 @@
import { readFileSync } from 'fs';
// Debug
import ModuleDebugBuilder from "./moduleDebugBuilder.js";
const log = new ModuleDebugBuilder("bot", "configHandler");
// Modules
import { readFileSync } from 'fs';
import path from "path";
export function getConfig() {
return JSON.parse(readFileSync("./config/botConfig.json"));
return JSON.parse(readFileSync(path.resolve("discord-bot/config/botConfig.json")));
}
export function getTOKEN() {
@@ -17,7 +19,7 @@ export function getTOKEN() {
export function getGuildID() {
const parsedJSON = getConfig();
const guildID = BigInt(parsedJSON.GuildID);
const guildID = parsedJSON.GuildID;
log.DEBUG("Guild ID: ", guildID);
return guildID;
@@ -25,7 +27,7 @@ export function getGuildID() {
export function getApplicationID() {
const parsedJSON = getConfig();
const appID = BigInt(parsedJSON.ApplicationID);
const appID = parsedJSON.ApplicationID;
log.DEBUG("Application ID: ", appID);
return appID;