Add top albums to fm command
All checks were successful
CI / CI (push) Successful in 1m23s

This commit is contained in:
SileNce5k 2025-05-12 03:08:25 +02:00
parent aa2ab653b9
commit 9cb5ea22cb
Signed by: SileNce
GPG key ID: B0A142BB4291B204
2 changed files with 23 additions and 21 deletions

View file

@ -35,6 +35,11 @@ module.exports = {
args.shift(); args.shift();
sendText = await getTopTracks(message.author.id, args, message.guild); sendText = await getTopTracks(message.author.id, args, message.guild);
break; break;
case "topalbums":
case "topalbum":
case "abl":
sendText = await getTopAlbums(message.author.id, args, message.guild)
break;
case "cover": case "cover":
sendText = await getCurrentCover(message.author.id, message.guild); sendText = await getCurrentCover(message.author.id, message.guild);
break; break;

View file

@ -93,27 +93,24 @@ module.exports = async function (userID, option, guild, compatibility=false) {
}); });
}); });
} }
// const embed = new EmbedBuilder() const embed = new EmbedBuilder()
// .setAuthor({name: `Top ${duration} albums for ${nickname}`, iconURL: user.user.avatarURL({ dynamic: true, size: 4096 })}) .setAuthor({name: `Top ${duration} albums for ${nickname}`, iconURL: user.user.avatarURL({ dynamic: true, size: 4096 })})
// .setThumbnail(albums[0].cover) .setColor(15780145)
// .setColor(15780145) let albumInfo = "";
// let tracksInfo = ""; for(let i = 0; i < albums.length; i++){
// for(let i = 0; i < albums.length; i++){ let pluralCharacter = albums[i].playcount > 1 ? 's' : '';
// let pluralCharacter = albums[i].playcount > 1 ? 's' : ''; let album = `${i}. **${albums[i].artist}** - ${albums[i].name} - *${albums[i].playcount} play${pluralCharacter}*`;
// let track = `${i}. **${albums[i].artist}** - ${albums[i].song} - *${albums[i].playcount} play${pluralCharacter}*`; if(i < albums.length - 1){
// if(i < albums.length - 1){ albumInfo += `${album}\n`;
// tracksInfo += `${track}\n`; }else{
// }else{ albumInfo += `${album}`;
// tracksInfo += `${track}`; }
// } }
// } embed.setDescription(albumInfo);
// embed.addFields({ sendText.embed = embed;
// name: ` `, value: `${tracksInfo}` if(compatibility)
// },)
// sendText.embed = embed;
// if(compatibility)
return albums; return albums;
// else else
// return sendText; return sendText;
} }