Cleaner Looking args

This commit is contained in:
Daniel Odendahl Jr
2017-05-02 17:54:07 +00:00
parent 57ee7fa82b
commit 3bb21c2df0
83 changed files with 787 additions and 616 deletions
+14 -14
View File
@@ -10,17 +10,19 @@ module.exports = class MathGameCommand extends Command {
group: 'games',
memberName: 'mathgame',
description: 'See how fast you can answer a math problem in a given time limit.',
args: [{
key: 'difficulty',
prompt: 'What should the difficulty of the math game be? `Easy`, `Medium`, `Hard`, `Extreme`, or `Impossible`?',
type: 'string',
validate: difficulty => {
if (['easy', 'medium', 'hard', 'extreme', 'impossible'].includes(difficulty.toLowerCase()))
return true;
return 'Please set the difficulty to either `easy`, `medium`, `hard`, `extreme`, or `impossible`.';
},
parse: difficulty => difficulty.toLowerCase()
}]
args: [
{
key: 'difficulty',
prompt: 'What should the difficulty of the math game be? `Easy`, `Medium`, `Hard`, `Extreme`, or `Impossible`?',
type: 'string',
validate: difficulty => {
if (['easy', 'medium', 'hard', 'extreme', 'impossible'].includes(difficulty.toLowerCase()))
return true;
return 'Please set the difficulty to either `easy`, `medium`, `hard`, `extreme`, or `impossible`.';
},
parse: difficulty => difficulty.toLowerCase()
}
]
});
}
@@ -48,9 +50,7 @@ module.exports = class MathGameCommand extends Command {
value = 10000;
break;
}
const value1 = Math.floor(Math.random() * value) + 1;
const value2 = Math.floor(Math.random() * value) + 1;
const expression = `${value1} ${operation} ${value2}`;
const expression = `${Math.floor(Math.random() * value) + 1} ${operation} ${Math.floor(Math.random() * value) + 1}`;
const solved = math.eval(expression).toString();
const embed = new RichEmbed()
.setTitle('You have **10** seconds to answer:')
+13 -11
View File
@@ -11,17 +11,19 @@ module.exports = class RockPaperScissorsCommand extends Command {
group: 'games',
memberName: 'rps',
description: 'Play Rock-Paper-Scissors.',
args: [{
key: 'choice',
prompt: '`Rock`, `Paper`, or `Scissors`?',
type: 'string',
validate: choice => {
if (['rock', 'paper', 'scissors'].includes(choice.toLowerCase()))
return true;
return 'Please enter either `rock`, `paper`, or `scissors`.';
},
parse: choice => choice.toLowerCase()
}]
args: [
{
key: 'choice',
prompt: '`Rock`, `Paper`, or `Scissors`?',
type: 'string',
validate: choice => {
if (['rock', 'paper', 'scissors'].includes(choice.toLowerCase()))
return true;
return 'Please enter either `rock`, `paper`, or `scissors`.';
},
parse: choice => choice.toLowerCase()
}
]
});
}
+13 -11
View File
@@ -9,17 +9,19 @@ module.exports = class TypingGameCommand extends Command {
group: 'games',
memberName: 'typinggame',
description: 'See how fast you can type a sentence in a given time limit.',
args: [{
key: 'difficulty',
prompt: 'What should the difficulty of the typing game be? `Easy`, `Medium`, `Hard`, `Extreme`, or `Impossible`?',
type: 'string',
validate: difficulty => {
if (['easy', 'medium', 'hard', 'extreme', 'impossible'].includes(difficulty.toLowerCase()))
return true;
return 'Please set the difficulty to either `easy`, `medium`, `hard`, `extreme`, or `impossible`.';
},
parse: difficulty => difficulty.toLowerCase()
}]
args: [
{
key: 'difficulty',
prompt: 'What should the difficulty of the typing game be? `Easy`, `Medium`, `Hard`, `Extreme`, or `Impossible`?',
type: 'string',
validate: difficulty => {
if (['easy', 'medium', 'hard', 'extreme', 'impossible'].includes(difficulty.toLowerCase()))
return true;
return 'Please set the difficulty to either `easy`, `medium`, `hard`, `extreme`, or `impossible`.';
},
parse: difficulty => difficulty.toLowerCase()
}
]
});
}