This commit is contained in:
Daniel Odendahl Jr
2017-05-05 14:09:06 +00:00
parent 1112ea9294
commit c607610016
+2 -2
View File
@@ -16,7 +16,7 @@ module.exports = class CurrencyCommand extends Command {
prompt: 'What currency code do you want to use as the base?', prompt: 'What currency code do you want to use as the base?',
type: 'string', type: 'string',
validate: base => { validate: base => {
if(codes[base.toUpperCase()]) if(codes.includes(base.toUpperCase()))
return true; return true;
return `${base} is not a valid currency code. Use \`help currency\` to view a list of codes.`; return `${base} is not a valid currency code. Use \`help currency\` to view a list of codes.`;
}, },
@@ -27,7 +27,7 @@ module.exports = class CurrencyCommand extends Command {
prompt: 'What currency code do you want to convert to?', prompt: 'What currency code do you want to convert to?',
type: 'string', type: 'string',
validate: to => { validate: to => {
if(codes[to.toUpperCase()]) if(codes.includes(to.toUpperCase()))
return true; return true;
return `${to} is not a valid currency code. Use \`help currency\` to view a list of codes.`; return `${to} is not a valid currency code. Use \`help currency\` to view a list of codes.`;
}, },