Skip to content

Commit 28b2920

Browse files
committed
fix galnir#623 spotify album not playing
1 parent d59b161 commit 28b2920

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

commands/music/play.js

+19-3
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,20 @@ module.exports = {
400400
});
401401
for (let i = 0; i < spotifyPlaylistItems.length; i++) {
402402
try {
403-
const video = await searchOne(spotifyPlaylistItems[i].track);
403+
let trackData;
404+
if (data.type == 'album') {
405+
trackData = {
406+
artists: spotifyPlaylistItems[i].artists,
407+
name: spotifyPlaylistItems[i].name
408+
};
409+
} else {
410+
trackData = {
411+
artists: spotifyPlaylistItems[i].track.artists,
412+
name: spotifyPlaylistItems[i].track.name
413+
};
414+
}
415+
416+
const video = await searchOne(trackData);
404417

405418
if (nextFlag || jumpFlag) {
406419
flagLogic(interaction, video, jumpFlag);
@@ -413,8 +426,11 @@ module.exports = {
413426
)
414427
);
415428
}
416-
} catch (error) {
417-
return interaction.followup(error);
429+
} catch (err) {
430+
processingMessage.delete();
431+
return interaction.followUp(
432+
'Failed to process playlist, please try again later'
433+
);
418434
}
419435
}
420436
processingMessage.edit('Playlist Processed!');

0 commit comments

Comments
 (0)