mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Merge pull request #56 from mariusbegby/play-count-from-track
Play count from track
This commit is contained in:
1 file changed
+13
-3
+13
-3
@@ -64,8 +64,16 @@ module.exports = {
|
|||||||
if (author === 'cdn.discordapp.com') {
|
if (author === 'cdn.discordapp.com') {
|
||||||
author = 'Unavailable';
|
author = 'Unavailable';
|
||||||
}
|
}
|
||||||
const plays =
|
let plays = currentTrack.views !== 0 ? currentTrack.views : 0;
|
||||||
currentTrack.views !== 0 ? currentTrack.views : 'Unavailable';
|
if (
|
||||||
|
plays === 0 &&
|
||||||
|
currentTrack.metadata.bridge.views !== 0 &&
|
||||||
|
currentTrack.metadata.bridge.views !== undefined
|
||||||
|
) {
|
||||||
|
plays = currentTrack.metadata.bridge.views;
|
||||||
|
} else {
|
||||||
|
plays = 'Unavailable';
|
||||||
|
}
|
||||||
const source =
|
const source =
|
||||||
sourceStringsFormatted.get(currentTrack.raw.source) ??
|
sourceStringsFormatted.get(currentTrack.raw.source) ??
|
||||||
'Unavailable';
|
'Unavailable';
|
||||||
@@ -195,7 +203,9 @@ module.exports = {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.member.nickname || interaction.user.username,
|
name:
|
||||||
|
interaction.member.nickname ||
|
||||||
|
interaction.user.username,
|
||||||
iconURL: interaction.user.avatarURL()
|
iconURL: interaction.user.avatarURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
|
|||||||
Reference in new issue
Block a user