diff --git a/Client/.env.example b/Client/.env.example index f5b9367..d3521fd 100644 --- a/Client/.env.example +++ b/Client/.env.example @@ -10,8 +10,6 @@ GUILD_ID="" # Audio Config AUDIO_DEVICE_ID="" AUDIO_DEVICE_NAME="" -# The level to open the noisegate and play audio to Discord, recommended to set to 10 -AUDIO_NOISE_GATE_OPEN="10" # Client Config CLIENT_ID= diff --git a/Client/controllers/botController.js b/Client/controllers/botController.js index d5b1baa..6b94aa7 100644 --- a/Client/controllers/botController.js +++ b/Client/controllers/botController.js @@ -2,9 +2,10 @@ const { DebugBuilder } = require("../utilities/debugBuilder.js"); const log = new DebugBuilder("client", "botController"); const botLog = new DebugBuilder("client", "botController:bot"); - +// Modules const spawn = require('child_process').spawn; const { resolve } = require("path"); +require('dotenv').config(); const { closeProcessWrapper } = require("../utilities/utilities"); // Global vars @@ -23,10 +24,10 @@ exports.getStatus = (req, res) => { * Start the bot and join the server and preset specified */ exports.joinServer = async (req, res) => { - if (!req.body.clientId || !req.body.deviceId || !req.body.channelId) return res.send("500").json({"message": "You must include the client ID (discord token), device ID (ID of the audio device to use), channel ID (The discord ID of the channel to connect to)"}); + if (!req.body.clientId || !req.body.channelId) return res.send("500").json({"message": "You must include the client ID (discord token), channel ID (The discord ID of the channel to connect to)"}); const deviceId = req.body.deviceId; const channelId = req.body.channelId; - const clientId = req.body.clientId; + const clientId = process.env.AUDIO_DEVICE_ID; const presetName = req.body.presetName; const NGThreshold = req.body.NGThreshold ?? 50