This commit is contained in:
Daniel Odendahl Jr
2018-03-23 22:35:21 +00:00
parent 9b8cc68b97
commit 0702a2d459
15 changed files with 48 additions and 96 deletions
+1 -4
View File
@@ -25,10 +25,7 @@ module.exports = class MathQuizCommand extends Command {
key: 'difficulty',
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
type: 'string',
validate: difficulty => {
if (difficulties.includes(difficulty.toLowerCase())) return true;
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
},
oneOf: difficulties,
parse: difficulty => difficulty.toLowerCase()
}
]
+2 -8
View File
@@ -24,10 +24,7 @@ module.exports = class QuizCommand extends Command {
prompt: `Which type of question would you like to have? Either ${list(types, 'or')}.`,
type: 'string',
default: 'multiple',
validate: type => {
if (types.includes(type.toLowerCase())) return true;
return `Invalid type, please enter either ${list(types, 'or')}.`;
},
oneOf: types,
parse: type => type.toLowerCase()
},
{
@@ -35,10 +32,7 @@ module.exports = class QuizCommand extends Command {
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
type: 'string',
default: '',
validate: difficulty => {
if (difficulties.includes(difficulty.toLowerCase())) return true;
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
},
oneOf: difficulties,
parse: difficulty => difficulty.toLowerCase()
}
]
+1 -4
View File
@@ -25,10 +25,7 @@ module.exports = class TypingTestCommand extends Command {
key: 'difficulty',
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
type: 'string',
validate: difficulty => {
if (difficulties.includes(difficulty.toLowerCase())) return true;
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
},
oneOf: difficulties,
parse: difficulty => difficulty.toLowerCase()
}
]