mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 00:07:36 +02:00
Better Error Handling
This commit is contained in:
@@ -15,9 +15,8 @@ module.exports = class MorseCommand extends Command {
|
||||
prompt: 'What text would you like to convert to morse?',
|
||||
type: 'string',
|
||||
validate: text => {
|
||||
if(letterTrans(text, dictionary, ' ').length < 1999)
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
if(letterTrans(text, dictionary, ' ').length < 1999) return true;
|
||||
return 'Your text is too long.';
|
||||
},
|
||||
parse: text => letterTrans(text.toLowerCase(), dictionary, ' ')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user