Initial update to try and fix #1
This commit is contained in:
31
Client/commands/status.js
Normal file
31
Client/commands/status.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// Debug
|
||||
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
||||
const log = new DebugBuilder("client-bot", "status");
|
||||
// Modules
|
||||
const {getVoiceConnection} = require("@discordjs/voice");
|
||||
// Utilities
|
||||
const { replyToInteraction } = require('../utilities/messageHandler.js');
|
||||
|
||||
|
||||
exports.status = async function status({interaction= undefined, guildID= undefined, callback = undefined}) {
|
||||
//if (!interaction && !guildID) // Need error of sorts
|
||||
if (interaction){
|
||||
guildID = interaction.guild.id;
|
||||
}
|
||||
const voiceConnection = getVoiceConnection(guildID);
|
||||
|
||||
const statusObj = {
|
||||
"guildID": guildID, "voiceConnection": voiceConnection
|
||||
}
|
||||
|
||||
//log.DEBUG('Status Object: ', statusObj);
|
||||
|
||||
// get the status and return it accordingly (message reply / module)
|
||||
|
||||
if (interaction) {
|
||||
return replyToInteraction(interaction, "Pong! I have Aids and now you do too!");
|
||||
}
|
||||
else {
|
||||
callback(statusObj);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user