Fixing small bugs
- Extra imports - incorrect param placement
This commit is contained in:
@@ -52,7 +52,7 @@ app.use(express.static(path.join(__dirname, 'public')));
|
|||||||
app.use('/', indexRouter);
|
app.use('/', indexRouter);
|
||||||
|
|
||||||
// Discord bot control route
|
// Discord bot control route
|
||||||
app.use('/bot', (res, req, next) => {
|
app.use('/bot', (req, res, next) => {
|
||||||
req.discordClient = discordClient; // Add the discord client to bot requests to be used downstream
|
req.discordClient = discordClient; // Add the discord client to bot requests to be used downstream
|
||||||
next();
|
next();
|
||||||
}, botRouter);
|
}, botRouter);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function getGuilds(req) {
|
|||||||
/**
|
/**
|
||||||
* Get Status of the discord process
|
* Get Status of the discord process
|
||||||
*/
|
*/
|
||||||
exports.getStatus = (res, req) => {
|
exports.getStatus = (req, res) => {
|
||||||
log.INFO("Getting the status of the bot");
|
log.INFO("Getting the status of the bot");
|
||||||
guildIds = getGuilds(req);
|
guildIds = getGuilds(req);
|
||||||
log.DEBUG("Guild IDs: ", guildIds);
|
log.DEBUG("Guild IDs: ", guildIds);
|
||||||
@@ -34,7 +34,7 @@ exports.getStatus = (res, req) => {
|
|||||||
/**
|
/**
|
||||||
* Start the bot and join the server and preset specified
|
* Start the bot and join the server and preset specified
|
||||||
*/
|
*/
|
||||||
exports.joinServer = (res, req) => {
|
exports.joinServer = (req, res) => {
|
||||||
const channelID = req.body.channelID;
|
const channelID = req.body.channelID;
|
||||||
const presetName = req.body.presetName;
|
const presetName = req.body.presetName;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ exports.joinServer = (res, req) => {
|
|||||||
/**
|
/**
|
||||||
* Leaves the server if it's in one
|
* Leaves the server if it's in one
|
||||||
*/
|
*/
|
||||||
exports.leaveServer = (res, req) => {
|
exports.leaveServer = (req, res) => {
|
||||||
leave({guildID: guildID, callback: (response) => {
|
leave({guildID: guildID, callback: (response) => {
|
||||||
return res.sendStatus(202);
|
return res.sendStatus(202);
|
||||||
}});
|
}});
|
||||||
|
|||||||
@@ -2,12 +2,11 @@
|
|||||||
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
||||||
const log = new DebugBuilder("client-bot", "commandController");
|
const log = new DebugBuilder("client-bot", "commandController");
|
||||||
// Modules
|
// Modules
|
||||||
const {getVoiceConnection} = require("@discordjs/voice");
|
|
||||||
const {replyToInteraction} = require("../utilities/messageHandler.js");
|
|
||||||
const { joinVoiceChannel, VoiceConnectionStatus, getVoiceConnection } = require("@discordjs/voice");
|
const { joinVoiceChannel, VoiceConnectionStatus, getVoiceConnection } = require("@discordjs/voice");
|
||||||
|
const { OpusEncoder } = require("@discordjs/opus");
|
||||||
|
// Utilities
|
||||||
const {replyToInteraction} = require("../utilities/messageHandler.js");
|
const {replyToInteraction} = require("../utilities/messageHandler.js");
|
||||||
const {createAudioInstance} = require("../controllers/audioController.js");
|
const {createAudioInstance} = require("../controllers/audioController.js");
|
||||||
const { OpusEncoder } = require("@discordjs/opus");
|
|
||||||
|
|
||||||
// Declare the encoder
|
// Declare the encoder
|
||||||
const encoder = new OpusEncoder(48000, 2);
|
const encoder = new OpusEncoder(48000, 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user