const {SlashCommandBuilder} = require("@discordjs/builders"); const { MessageEmbed } = require("discord.js"); module.exports = { data: new SlashCommandBuilder() .setName("queue") .setDescription("shows first 10 tunes in the queue"), execute: async ({client, interaction}) => { const queue = client.player.getQueue(interaction.guild); // check if there are tunes in the queue if (!queue || !queue.playing){ await interaction.reply("There are no tunes in the queue"); return; } // Get the first 10 tunes in the queue const queueString = queue.tracks.slice(0, 10).map((song, i) => { return `${i}) [${song.duration}]\` ${song.title} - <@${song.requestedBy.id}>`; }).join("\n"); // Get the current song const currentSong = queue.current await interaction.reply({ embeds: [ new MessageEmbed() .setDescription(`**Currently Playing**\n` + (currentSong ? `\`[${currentSong.duration}]\` ${currentSong.title} - <@${currentSong.requestedBy.id}>` : "None") + `\n\n**Queue**\n${queueString}` ) .setThumbnail(currentSong.setThumbnail) ] }) } }