From 75ad7fecaac1a7510332b9aba46a50524557e2cf Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sun, 16 Apr 2017 19:10:42 +0000 Subject: [PATCH] Fix Pokedex --- commands/search/pokedex.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/search/pokedex.js b/commands/search/pokedex.js index eb34b131..14911b36 100644 --- a/commands/search/pokedex.js +++ b/commands/search/pokedex.js @@ -33,7 +33,7 @@ module.exports = class PokedexCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const index = args.index; + let index = args.index; let dex = 'xy'; let location = 'foox'; let location2 = 'fooy'; @@ -42,10 +42,10 @@ module.exports = class PokedexCommand extends Command { location = 'foosun'; location2 = 'foomoon'; } + index = index.toString(); + const pad = '000'.slice(index.length); + index = `${pad}${index}`; try { - index = index.toString(); - const pad = '000'.slice(index.length); - index = `${pad}${index}`; const response = await snekfetch .get(`http://www.serebii.net/pokedex-${dex}/${index}.shtml`); const $ = cheerio.load(response.text);