toLowerCase test

This commit is contained in:
Daniel Odendahl Jr
2017-03-25 05:56:48 +00:00
parent 80ec222f81
commit 2481a70e32
+5 -5
View File
@@ -12,19 +12,19 @@ module.exports = class MathGameCommand extends commando.Command {
examples: [';mathgame easy', ';mathgame medium', ';mathgame hard', ';mathgame extreme'],
args: [{
key: 'difficulty',
prompt: 'What difficulty should the math game be? Easy, Medium, Hard, or Extreme?',
prompt: 'What difficulty should the math game be? easy, medium, hard, or extreme?',
type: 'string',
validate: difficulty => {
if (difficulty === 'easy') {
if (difficulty.toLowerCase() === 'easy') {
return true;
}
else if (difficulty === 'medium') {
else if (difficulty.toLowerCase() === 'medium') {
return true;
}
else if (difficulty === 'hard') {
else if (difficulty.toLowerCase() === 'hard') {
return true;
}
else if (difficulty === 'extreme') {
else if (difficulty.toLowerCase() === 'extreme') {
return true;
}
return 'Please set the difficulty to either `easy`, `medium`, `hard`, or `extreme`.';