Better Error Handling

This commit is contained in:
Daniel Odendahl Jr
2017-05-05 21:37:30 +00:00
parent d8a773958d
commit 13cbd23f2f
54 changed files with 120 additions and 156 deletions
+1 -2
View File
@@ -17,8 +17,7 @@ module.exports = class RockPaperScissorsCommand extends Command {
prompt: '`Rock`, `Paper`, or `Scissors`?',
type: 'string',
validate: choice => {
if(['rock', 'paper', 'scissors'].includes(choice.toLowerCase()))
return true;
if(['rock', 'paper', 'scissors'].includes(choice.toLowerCase())) return true;
return 'Please enter either `rock`, `paper`, or `scissors`.';
},
parse: choice => choice.toLowerCase()