diff --git a/structures/pokemon/AbilityStore.js b/structures/pokemon/AbilityStore.js index b33d51b8..361ff7eb 100644 --- a/structures/pokemon/AbilityStore.js +++ b/structures/pokemon/AbilityStore.js @@ -8,7 +8,8 @@ module.exports = class AbilityStore extends Collection { } async fetch(query) { - query = this.makeSlug(query); + if (this.has(query)) return this.get(query); + query = this.makeSlug(query.toString()); if (!query) return null; const found = this.find(pokemon => pokemon.slug === query); if (found) return found; diff --git a/structures/pokemon/MoveStore.js b/structures/pokemon/MoveStore.js index 74b356f4..d91edd8d 100644 --- a/structures/pokemon/MoveStore.js +++ b/structures/pokemon/MoveStore.js @@ -8,7 +8,8 @@ module.exports = class MoveStore extends Collection { } async fetch(query) { - query = this.makeSlug(query); + if (this.has(query)) return this.get(query); + query = this.makeSlug(query.toString()); if (!query) return null; const found = this.find(pokemon => pokemon.slug === query); if (found) return found; diff --git a/structures/pokemon/PokemonStore.js b/structures/pokemon/PokemonStore.js index e30fa6f6..a3399921 100644 --- a/structures/pokemon/PokemonStore.js +++ b/structures/pokemon/PokemonStore.js @@ -17,7 +17,8 @@ module.exports = class PokemonStore extends Collection { } async fetch(query) { - query = this.makeSlug(query); + if (this.has(query)) return this.get(query); + query = this.makeSlug(query.toString()); if (!query) return null; const num = Number.parseInt(query, 10); if (this.has(num)) return this.get(num);