Merge pull request #56 from mariusbegby/play-count-from-track

Play count from track
This commit is contained in:
Marius Begby authored and GitHub committed 2023-07-15 04:43:43 +02:00
commit cc4db0da22
1 file changed
+13 -3
+13 -3
View File
@@ -64,8 +64,16 @@ module.exports = {
if (author === 'cdn.discordapp.com') {
author = 'Unavailable';
}
const plays =
currentTrack.views !== 0 ? currentTrack.views : 'Unavailable';
let plays = currentTrack.views !== 0 ? currentTrack.views : 0;
if (
plays === 0 &&
currentTrack.metadata.bridge.views !== 0 &&
currentTrack.metadata.bridge.views !== undefined
) {
plays = currentTrack.metadata.bridge.views;
} else {
plays = 'Unavailable';
}
const source =
sourceStringsFormatted.get(currentTrack.raw.source) ??
'Unavailable';
@@ -195,7 +203,9 @@ module.exports = {
embeds: [
new EmbedBuilder()
.setAuthor({
name: interaction.member.nickname || interaction.user.username,
name:
interaction.member.nickname ||
interaction.user.username,
iconURL: interaction.user.avatarURL()
})
.setDescription(