diff --git a/commands/games-sp/whos-that-pokemon-cry.js b/commands/games-sp/whos-that-pokemon-cry.js index 83967a86..5f6631a1 100644 --- a/commands/games-sp/whos-that-pokemon-cry.js +++ b/commands/games-sp/whos-that-pokemon-cry.js @@ -2,6 +2,7 @@ const Command = require('../../structures/Command'); const { Readable } = require('stream'); const { reactIfAble } = require('../../util/Util'); const pokemonCount = 893; +const blacklist = [0, 803, 804, 805, 806, 807, 808, 809, 890, 891, 892, 893]; module.exports = class WhosThatPokemonCryCommand extends Command { constructor(client) { @@ -59,7 +60,15 @@ module.exports = class WhosThatPokemonCryCommand extends Command { type: 'integer', max: pokemonCount, min: 0, - default: () => Math.floor(Math.random() * (pokemonCount + 1)) + default: () => { + let num; + while (!num) { + const chosen = Math.floor(Math.random() * (pokemonCount + 1)); + if (blacklist.includes(chosen)) continue; + num = chosen; + } + return num; + } } ] }); diff --git a/structures/pokemon/Pokemon.js b/structures/pokemon/Pokemon.js index e676c335..7cca897d 100644 --- a/structures/pokemon/Pokemon.js +++ b/structures/pokemon/Pokemon.js @@ -112,6 +112,7 @@ module.exports = class Pokemon { async fetchCry() { if (this.cry) return this.cry; + if (this.missingno) return null; try { const { body } = await request.get(`https://pokemoncries.com/cries/${this.id}.mp3`); this.cry = body;