Files
BluBot/commands/music/stop.js
2025-06-21 15:13:58 -05:00

21 lines
711 B
JavaScript

const { SlashCommandBuilder } = require("discord.js");
const { resetAll, setStopped } = require("../../playback");
module.exports = {
data: new SlashCommandBuilder()
.setName("stop")
.setDescription("Stop playback and leave the voice channel"),
async execute(interaction) {
const voiceChannel = interaction.member.voice.channel;
if (!voiceChannel) {
return interaction.reply({ content: "You need to be in a voice channel to use this command.", ephemeral: true });
}
setStopped(true); // Mark playback as stopped
resetAll(voiceChannel.guild.id); // Reset everything for a clean state
return interaction.reply("Stopped playback and left the voice channel.");
},
};