mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2025-09-21 06:41:35 +01:00
22 lines
638 B
JavaScript
22 lines
638 B
JavaScript
const { SlashCommandBuilder } = require("discord.js");
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName("shuffle")
|
|
.setDescription("Shuffles the current queue"),
|
|
async execute(interaction, client) {
|
|
const queue = client.distube.getQueue(interaction.guildId);
|
|
|
|
if (!queue || queue.songs.length <= 2) {
|
|
return interaction.reply("❌ Not enough songs in the queue to shuffle!");
|
|
}
|
|
|
|
try {
|
|
await queue.shuffle();
|
|
interaction.reply("🔀 Shuffled the queue!");
|
|
} catch (error) {
|
|
console.error(error);
|
|
interaction.reply("❌ Failed to shuffle the queue.");
|
|
}
|
|
},
|
|
};
|