From bba0d2d87ce6847e8767f3a40629f54c5b701dbe Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Mon, 18 Jan 2021 18:06:57 -0500 Subject: [PATCH] Fix --- commands/pokedex/pokedex-stats.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/pokedex/pokedex-stats.js b/commands/pokedex/pokedex-stats.js index 0268c141..d14a8dbd 100644 --- a/commands/pokedex/pokedex-stats.js +++ b/commands/pokedex/pokedex-stats.js @@ -54,13 +54,14 @@ module.exports = class PokedexCommand extends Command { const data = await this.client.pokemon.fetch(pokemon); if (!data) return msg.say('Could not find any results.'); if (!data.gameDataCached) await data.fetchGameData(); - const variety = data.varieties.find(vrity => { + const displayForms = data.varieties.filter(vrity => vrity.statsDiffer); + const variety = displayForms.find(vrity => { if (!form || form === 'normal') return vrity.default; if (!vrity.name) return false; return vrity.name.toLowerCase() === form; }); if (!variety) { - const varieties = data.varieties.map(vrity => vrity.name || 'Normal'); + const varieties = displayForms.map(vrity => vrity.name || 'Normal'); return msg.say(`Invalid form. The forms available for this Pokémon are: ${list(varieties, 'and')}`); } const statTotal = data.baseStatTotal(variety.id); @@ -73,7 +74,6 @@ module.exports = class PokedexCommand extends Command { spd: Math.round((variety.stats.spd / 255) * 10) * 2, total: Math.round((statTotal / 1125) * 10) * 2 }; - const displayForms = data.varieties.filter(vrity => vrity.statsDiffer); const embed = new MessageEmbed() .setColor(0xED1C24) .setAuthor(`#${data.displayID} - ${data.name}`, data.boxImageURL, data.serebiiURL)