From 4bba2644d95856bedd5922135564927c519301a8 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sat, 21 Oct 2017 21:12:10 +0000 Subject: [PATCH] Fix --- commands/search/league-of-legends-champion.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/search/league-of-legends-champion.js b/commands/search/league-of-legends-champion.js index 18fe8f23..15bb2f2a 100644 --- a/commands/search/league-of-legends-champion.js +++ b/commands/search/league-of-legends-champion.js @@ -30,9 +30,9 @@ module.exports = class LeagueOfLegendsChampionCommand extends Command { const search = await snekfetch .get('https://na1.api.riotgames.com/lol/static-data/v3/champions') .query({ api_key: RIOT_KEY }); - const key = Object.keys(search.body.data).find(key => key.toLowerCase() === champion); - if (!key) return msg.say('Could not find any results.'); - const { id } = search.body.data[key]; + const name = Object.keys(search.body.data).find(key => key.toLowerCase() === champion); + if (!name) return msg.say('Could not find any results.'); + const { id } = search.body.data[name]; const { body } = await snekfetch .get(`https://na1.api.riotgames.com/lol/static-data/v3/champions/${id}`) .query({