From 70ba2ed970401af30e7bb5232d4d97daa26de63c Mon Sep 17 00:00:00 2001 From: Ayden Jahola Date: Wed, 2 Oct 2024 18:26:49 +0100 Subject: [PATCH] make tracker score only show in current stats as doesnt exist in all acts --- commands/stats/valorant.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/commands/stats/valorant.js b/commands/stats/valorant.js index 9092127..d0a90a3 100644 --- a/commands/stats/valorant.js +++ b/commands/stats/valorant.js @@ -79,17 +79,21 @@ module.exports = { { name: "🎯 Headshot Percentage", value: `${data.headshot_percentage}%`, - }, - { - name: "💯 Tracker Score", - value: `${data.tracker_score}/1000`, } - ) - .setTimestamp() - .setFooter({ - text: "Valorant Stats API made by Ayden", - iconURL: interaction.guild.iconURL(), + ); + + // Add the Tracker Score field only if statsType is "current" + if (statsType === "current") { + statsEmbed.addFields({ + name: "💯 Tracker Score", + value: `${data.tracker_score}/1000`, }); + } + + statsEmbed.setTimestamp().setFooter({ + text: "Valorant Stats API made by Ayden", + iconURL: interaction.guild.iconURL(), + }); return interaction.editReply({ embeds: [statsEmbed] }); } catch (error) {