diff --git a/commands/search/league-of-legends-champion.js b/commands/search/league-of-legends-champion.js index 15bb2f2a..ad651bb3 100644 --- a/commands/search/league-of-legends-champion.js +++ b/commands/search/league-of-legends-champion.js @@ -26,6 +26,7 @@ module.exports = class LeagueOfLegendsChampionCommand extends Command { } async run(msg, { champion }) { + if (champion === 'satan') champion = 'teemo'; try { const search = await snekfetch .get('https://na1.api.riotgames.com/lol/static-data/v3/champions') diff --git a/commands/text-edit/translate.js b/commands/text-edit/translate.js index 4b770ccc..ee45b1bd 100644 --- a/commands/text-edit/translate.js +++ b/commands/text-edit/translate.js @@ -31,13 +31,13 @@ module.exports = class TranslateCommand extends Command { type: 'string', validate: target => { const value = target.toLowerCase(); - if (codes[value] || Object.values(codes).find(entry => entry.toLowerCase() === value)) return true; + if (codes[value] || Object.keys(codes).find(key => codes[key.toLowerCase()] === value)) return true; return `Invalid target, please enter either ${list(Object.keys(codes), 'or')}.`; }, parse: target => { const value = target.toLowerCase(); if (codes[value]) return value; - return codes[Object.values(codes).find(entry => entry.toLowerCase() === value)]; + return Object.keys(codes).find(key => codes[key.toLowerCase()] === value); } }, { @@ -47,13 +47,13 @@ module.exports = class TranslateCommand extends Command { default: '', validate: base => { const value = base.toLowerCase(); - if (codes[value] || Object.values(codes).find(entry => entry.toLowerCase() === value)) return true; + if (codes[value] || Object.keys(codes).find(key => codes[key.toLowerCase()] === value)) return true; return `Invalid base, please enter either ${list(Object.keys(codes), 'or')}.`; }, parse: base => { const value = base.toLowerCase(); if (codes[value]) return value; - return codes[Object.values(codes).find(entry => entry.toLowerCase() === value)]; + return Object.keys(codes).find(key => codes[key.toLowerCase()] === value); } } ]