diff --git a/commands/Music/pause.js b/commands/Music/pause.js index f5bf77b..bc95634 100644 --- a/commands/Music/pause.js +++ b/commands/Music/pause.js @@ -2,9 +2,44 @@ const { SlashCommandBuilder } = require("@discordjs/builders"); const { embedMessage } = require("../../modules/embedSimple"); module.exports = { + name: "pause", + args: false, + description: "Pauses the current playing song", + usage: "pause", + async run(message, args, client) { + const queue = client.player.getQueue(message.guild); + + if (!queue || !queue.playing) + return await message.channel.send({ + embeds: [ + embedMessage("#9dcc37", `❌ | There is nothing playing to pause!`), + ], + }); + + try { + if (queue) { + await queue.setPaused(true); + return await message.channel.send({ + embeds: [ + embedMessage( + "#9dcc37", + `✅ **${ + queue.current.title + }** paused [${message.member.toString()}]` + ), + ], + }); + } + } catch (err) { + client.logger(err.message, "error"); + await message.channel.send({ + embeds: [embedMessage("#9dcc37", "Could not pause the song")], + }); + } + }, data: new SlashCommandBuilder() .setName("pause") - .setDescription("pauses the song"), + .setDescription("Pauses the current playing song"), async execute(interaction, client) { await interaction.deferReply(); diff --git a/commands/Music/queue.js b/commands/Music/queue.js index d0611e0..701a37f 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -2,9 +2,43 @@ const { SlashCommandBuilder } = require("@discordjs/builders"); const { embedMessage } = require("../../modules/embedSimple"); module.exports = { + name: "queue", + aliases: ["q"], + args: false, + description: "Shows all queued songs", + usage: "pause", + async run(message, args, client) { + const queue = client.player.getQueue(message.guild); + + if (!queue) { + return await message.channel.send({ + embeds: [ + embedMessage("#9dcc37", `❌ | Nothing to list, Queue is empty`), + ], + }); + } + + const tracks = queue?.tracks?.map( + (track) => `<@${track.requestedBy.id}>, ${track.title}` + ); + const queueEmbed = { + color: "#9dcc37", + title: `Queue contains ${queue?.tracks.length} songs!`, + author: { + name: `${message.member.user.username}`, + icon_url: `${message.member.user.avatarURL()}`, + }, + description: `${tracks.join("\n")}`, + footer: { + text: `Playing Now: ${queue?.nowPlaying() || "Nothing"}`, + }, + }; + + await message.channel.send({ embeds: [queueEmbed] }); + }, data: new SlashCommandBuilder() .setName("queue") - .setDescription("Shows the current queue"), + .setDescription("Shows all queued songs"), async execute(interaction, client) { await interaction.deferReply(); @@ -23,13 +57,15 @@ module.exports = { ); const queueEmbed = { color: "#9dcc37", - title: `Current Queue`, + title: `Queue contains ${queue?.tracks.length} songs!`, author: { name: `${interaction.user.username}`, icon_url: `${interaction.user.avatarURL()}`, }, description: `${tracks.join("\n")}`, - timestamp: new Date(), + footer: { + text: `Playing Now: ${queue?.nowPlaying() || "Nothing"}`, + }, }; await interaction.followUp({ embeds: [queueEmbed] });