Halfbroken fixes

This commit is contained in:
Myx
2023-06-28 03:02:41 +02:00
parent 6a001604ab
commit f533e38333
18 changed files with 545 additions and 421 deletions

View File

@@ -1,30 +1,30 @@
const musicQueue = require("../musicQueue");
const { getVoiceConnection } = require("@discordjs/voice");
const { getVoiceConnection } = require('@discordjs/voice');
const musicQueue = require('../musicQueue');
async function stopCommand(interaction) {
await interaction.deferReply();
await interaction.deferReply();
const voiceChannel = interaction.member.voice.channel;
const connection = getVoiceConnection(interaction.guild.id);
const voiceChannel = interaction.member.voice.channel;
const connection = getVoiceConnection(interaction.guild.id);
if (!voiceChannel) {
return interaction.followUp(
"You must be in a voice channel to use this command."
);
}
if (!voiceChannel) {
return interaction.followUp(
'You must be in a voice channel to use this command.',
);
}
const guildId = interaction.guild.id;
const guildId = interaction.guild.id;
if (!connection.state.subscription.player) {
return interaction.followUp(
"I am not currently playing music in a voice channel."
);
}
if (!connection.state.subscription.player) {
return interaction.followUp(
'I am not currently playing music in a voice channel.',
);
}
connection.state.subscription.player.stop();
musicQueue.clearQueue(guildId);
connection.state.subscription.player.stop();
musicQueue.clearQueue(guildId);
interaction.followUp("Stopped the music and cleared the queue.");
return interaction.followUp('Stopped the music and cleared the queue.');
}
module.exports.stopCommand = stopCommand;
module.exports.stopCommand = stopCommand;