mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
Better Validators and More Destucturing
This commit is contained in:
@@ -21,10 +21,10 @@ module.exports = class BinaryCommand extends Command {
|
||||
prompt: 'What text would you like to convert to binary?',
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (stringToBinary(content).length > 1950) {
|
||||
return 'Your message content is too long.';
|
||||
if (stringToBinary(content).length < 2000) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return 'Your message content is too long.';
|
||||
},
|
||||
parse: text => {
|
||||
return stringToBinary(text);
|
||||
|
||||
Reference in New Issue
Block a user