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

This commit is contained in:
SileNce5k 2025-05-12 17:52:03 +02:00
parent 9cb5ea22cb
commit 4f57499cca
Signed by: SileNce
GPG key ID: B0A142BB4291B204
2 changed files with 24 additions and 21 deletions

View file

@ -40,6 +40,12 @@ module.exports = {
case "abl": case "abl":
sendText = await getTopAlbums(message.author.id, args, message.guild) sendText = await getTopAlbums(message.author.id, args, message.guild)
break; break;
case "topartists":
case "topartist":
case "ta":
case "as":
sendText = await getTopArtists(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

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