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
+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()
}
]
});
}