This commit is contained in:
Daniel Odendahl Jr
2017-10-21 21:19:12 +00:00
parent 4bba2644d9
commit a4793cf535
2 changed files with 5 additions and 4 deletions
@@ -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')
+4 -4
View File
@@ -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);
}
}
]