From be5fb228449fae60086d2926121408e34cc043aa Mon Sep 17 00:00:00 2001 From: Prince527 Date: Sun, 10 Mar 2024 18:16:45 -0300 Subject: [PATCH] Fixed music part 2 --- SlashCommands/music/play.js | 4 ++-- website/router/api.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SlashCommands/music/play.js b/SlashCommands/music/play.js index 39fa924..0081edc 100644 --- a/SlashCommands/music/play.js +++ b/SlashCommands/music/play.js @@ -73,7 +73,7 @@ module.exports = { ] }); - } else if (loadType === "track") { + } else if (loadType === "search" || loadType === "track") { const track = tracks.shift(); track.info.requester = interaction.member; @@ -84,7 +84,7 @@ module.exports = { embeds: [ new EmbedBuilder() .setDescription(`✅ **|** **[${track.info.title}](${track.info.uri})** has been added to the queue`) - .setThumbnail(`${track.info.image ? track.info.image : 'https://api.serversmp.xyz/upload/1/prince/hXLEkmnukU.png'}`) + .setThumbnail(`${track.info.artworkUrl || 'https://api.serversmp.xyz/upload/1/prince/hXLEkmnukU.png'}`) .setColor("Blue") ] }); diff --git a/website/router/api.js b/website/router/api.js index c5d320b..2f36d9c 100644 --- a/website/router/api.js +++ b/website/router/api.js @@ -53,7 +53,7 @@ router.post("/music/play", checkAPIAuth, async (req, res) => { length: tracks.length, title: playlistInfo.name }; - } else if (loadType === "track") { + } else if (loadType === "search" || loadType === "track") { const track = tracks.shift(); track.info.requester = member; player.queue.add(track); @@ -61,7 +61,7 @@ router.post("/music/play", checkAPIAuth, async (req, res) => { api.track = { title: track.info.title, url: track.info.uri, - image: track.info.image + image: track.info.artworkUrl }; } else return res.json({ error: "Failed to find your song" });