Skip to content

Commit

Permalink
[New] Added new interaction.followUp for the play command in case the…
Browse files Browse the repository at this point in the history
… search result was a playlist
  • Loading branch information
naseif committed Aug 30, 2021
1 parent 90d82ac commit 5bc8723
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions commands/music/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ module.exports = {
});

const guild = client.guilds.cache.get(interaction.guildId);
const channel = guild.channels.cache.get(interaction.channelId);

const songString = interaction.options.getString("song");

Expand Down Expand Up @@ -106,13 +105,26 @@ module.exports = {
},
};

let playlistEmbed = {
color: "#9dcc37",
description: `✅ | Queued ${queue.tracks.length} Songs`,
};

if (!queue.playing) {
await interaction.followUp({ embeds: [musicEmbed] });
searchSong.playlist
? await interaction.followUp({
embeds: [playlistEmbed, musicEmbed],
})
: await interaction.followUp({
embeds: [musicEmbed],
});
await queue.play();
}

if (queue.playing) {
await interaction.followUp({ embeds: [musicEmbed] });
searchSong.playlist
? await interaction.followUp({ embeds: [playlistEmbed, musicEmbed] })
: await interaction.followUp({ embeds: [musicEmbed] });
}
},
};

0 comments on commit 5bc8723

Please sign in to comment.