mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 00:07:36 +02:00
Fix
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user