mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
@@ -24,8 +24,12 @@ module.exports = class MathQuizCommand extends Command {
|
||||
{
|
||||
key: 'difficulty',
|
||||
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
|
||||
type: 'choice',
|
||||
choices: difficulties
|
||||
type: 'string',
|
||||
validate: difficulty => {
|
||||
if (difficulties.includes(difficulty.toLowerCase())) return true;
|
||||
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
|
||||
},
|
||||
parse: difficulty => difficulty.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
+12
-4
@@ -22,16 +22,24 @@ module.exports = class QuizCommand extends Command {
|
||||
{
|
||||
key: 'type',
|
||||
prompt: `Which type of question would you like to have? Either ${list(types, 'or')}.`,
|
||||
type: 'choice',
|
||||
type: 'string',
|
||||
default: 'multiple',
|
||||
choices: types
|
||||
validate: type => {
|
||||
if (types.includes(type.toLowerCase())) return true;
|
||||
return `Invalid type, please enter either ${list(types, 'or')}.`;
|
||||
},
|
||||
parse: type => type.toLowerCase()
|
||||
},
|
||||
{
|
||||
key: 'difficulty',
|
||||
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
|
||||
type: 'choice',
|
||||
type: 'string',
|
||||
default: '',
|
||||
choices: difficulties
|
||||
validate: difficulty => {
|
||||
if (difficulties.includes(difficulty.toLowerCase())) return true;
|
||||
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
|
||||
},
|
||||
parse: difficulty => difficulty.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
@@ -13,8 +13,8 @@ module.exports = class RockPaperScissorsCommand extends Command {
|
||||
{
|
||||
key: 'choice',
|
||||
prompt: 'Rock, Paper, or Scissors?',
|
||||
type: 'choice',
|
||||
choices
|
||||
type: 'string',
|
||||
parse: choice => choice.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
@@ -24,8 +24,12 @@ module.exports = class TypingTestCommand extends Command {
|
||||
{
|
||||
key: 'difficulty',
|
||||
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
|
||||
type: 'choice',
|
||||
choices: difficulties
|
||||
type: 'string',
|
||||
validate: difficulty => {
|
||||
if (difficulties.includes(difficulty.toLowerCase())) return true;
|
||||
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
|
||||
},
|
||||
parse: difficulty => difficulty.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user