From 1b05a94d1e992caebbc83058be8042c8259b4cc2 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 3 Dec 2020 10:44:13 -0500 Subject: [PATCH] Include chain fetch in game data --- commands/search/pokedex.js | 1 - structures/pokemon/Pokemon.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/search/pokedex.js b/commands/search/pokedex.js index bcfc1fc3..a0caad00 100644 --- a/commands/search/pokedex.js +++ b/commands/search/pokedex.js @@ -62,7 +62,6 @@ 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(); - if (!data.chain.data.length) await data.fetchChain(); const typesShown = data.varieties.filter(variety => variety.display); const repeat = { hp: Math.round((data.stats.hp / 255) * 10) * 2, diff --git a/structures/pokemon/Pokemon.js b/structures/pokemon/Pokemon.js index 0b744d57..775a4685 100644 --- a/structures/pokemon/Pokemon.js +++ b/structures/pokemon/Pokemon.js @@ -97,6 +97,7 @@ module.exports = class Pokemon { const { body } = await request.get(ability.ability.url); this.abilities.push(body.names.find(name => name.language.name === 'en').name); } + await this.fetchChain(); this.gameDataCached = true; return this; }