discord-multipurpose-bot/commands/music/queue.js
2025-09-19 23:54:20 +01:00

18 lines
610 B
JavaScript

const { SlashCommandBuilder } = require("discord.js");
module.exports = {
data: new SlashCommandBuilder()
.setName("queue")
.setDescription("Shows the current music queue."),
async execute(interaction, client) {
const queue = client.distube.getQueue(interaction.guildId);
if (!queue || queue.songs.length === 0) {
return interaction.reply("❌ The queue is empty!");
}
const tracks = queue.songs.map(
(song, index) =>
`${index + 1}. ${song.name} - \`${song.formattedDuration}\``
);
interaction.reply(`**Current Queue:**\n${tracks.join("\n")}`);
},
};