mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Better Error Handling
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user