Make sure music search results aren't counted as playlists
This commit is contained in:
parent
4caad42240
commit
3b4b302634
1 changed files with 2 additions and 1 deletions
|
@ -67,7 +67,8 @@ export async function play(client, sound, message, music = false) {
|
|||
const oldQueue = queues.get(voiceChannel.guild.id);
|
||||
if (!tracks || tracks.length === 0) return "I couldn't find that song!";
|
||||
if (music) {
|
||||
const playlistTracks = tracks.map((val) => { return val.track; });
|
||||
const sortedTracks = tracks.map((val) => { return val.track; });
|
||||
const playlistTracks = playlistInfo.selectedTrack !== undefined ? sortedTracks : [sortedTracks[0]];
|
||||
queues.set(voiceChannel.guild.id, oldQueue ? [...oldQueue, ...playlistTracks] : playlistTracks);
|
||||
}
|
||||
const connection = await manager.join({
|
||||
|
|
Loading…
Reference in a new issue