From 2364770b8fbe5729b1b1fae433bbb979f3702a86 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 22 Jan 2021 18:17:48 -0500 Subject: [PATCH] Fix --- structures/pokemon/AbilityStore.js | 3 ++- structures/pokemon/MoveStore.js | 3 ++- structures/pokemon/PokemonStore.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) 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);