From a41cc9b51dbb6f8b6709c98328b0d56b3ab64872 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sat, 15 Jun 2024 08:22:41 -0400 Subject: [PATCH] Moved a lot from env to config --- data/config.json | 5 ++++- main.js | 3 +-- modules/_clear-commands.js | 2 +- modules/_deploy-global.js | 2 +- modules/functions.js | 3 ++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/data/config.json b/data/config.json index 05eb669..ebb12a4 100644 --- a/data/config.json +++ b/data/config.json @@ -1,4 +1,7 @@ { + "debugMode": true, "guildId": "", - "validCommands": [] + "statusChannelId": "1112151867821146152", + "botId": "1074882226665312356", + "validCommands": [], } \ No newline at end of file diff --git a/main.js b/main.js index 43dd893..06f4ca1 100644 --- a/main.js +++ b/main.js @@ -16,8 +16,7 @@ const client = new Client({ // Various imports const fn = require('./modules/functions.js'); const strings = require('./data/strings.json'); -const debugMode = process.env.DEBUG; -const statusChannelId = process.env.STATUSCHANNELID +const { debugMode, statusChannelId } = require('./data/config.json'); //TODO add debug logic to boot message client.once('ready', () => { fn.collectionBuilders.slashCommands(client); diff --git a/modules/_clear-commands.js b/modules/_clear-commands.js index 34ee25d..100916b 100644 --- a/modules/_clear-commands.js +++ b/modules/_clear-commands.js @@ -3,7 +3,7 @@ const dotenv = require('dotenv'); dotenv.config(); const { REST, Routes } = require('discord.js'); -const botId = process.env.BOTID; +const { botId } = require('../data/config.json'); const token = process.env.TOKEN; const fs = require('fs'); diff --git a/modules/_deploy-global.js b/modules/_deploy-global.js index f3c7c92..8875122 100644 --- a/modules/_deploy-global.js +++ b/modules/_deploy-global.js @@ -3,7 +3,7 @@ const dotenv = require('dotenv'); dotenv.config(); const { REST, Routes } = require('discord.js'); -const botId = process.env.BOTID; +const { botId } = require('../data/config.json'); const token = process.env.TOKEN; const fs = require('fs'); diff --git a/modules/functions.js b/modules/functions.js index 2e0ab4d..790d82b 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -9,8 +9,9 @@ const Discord = require('discord.js'); const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = Discord; // Various imports from other files -const debugMode = process.env.DEBUG; + const config = require('../data/config.json'); +const { debugMode } = config; const strings = require('../data/strings.json'); const slashCommandFiles = fs.readdirSync('./slash-commands/').filter(file => file.endsWith('.js'));