mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Better Validators and More Destucturing
This commit is contained in:
@@ -21,7 +21,7 @@ module.exports = class MemeCommand extends Command {
|
||||
if (memecodes.includes(type.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
return 'Please enter a valid meme type. Use `;help meme` to view a list of types.';
|
||||
return `${type.toLowerCase()} is not a valid meme type. Use \`;help meme\` to view a list of types.`;
|
||||
},
|
||||
parse: text => {
|
||||
return text.toLowerCase();
|
||||
@@ -34,7 +34,7 @@ module.exports = class MemeCommand extends Command {
|
||||
if (toprow.match(/^[a-zA-Z0-9.,!?'\s]+$/) && toprow.length < 101) {
|
||||
return true;
|
||||
}
|
||||
return 'Please do not use special characters and keep the rows under 100 characters each.';
|
||||
return `Please do not use special characters and keep the rows under 100 characters each, you have ${toprow.length}.`;
|
||||
},
|
||||
parse: text => {
|
||||
return text.replace(/[ ]/g, '-').replace(/[?]/g, '~q');
|
||||
@@ -47,7 +47,7 @@ module.exports = class MemeCommand extends Command {
|
||||
if (bottomrow.match(/^[a-zA-Z0-9.,!?'\s]+$/) && bottomrow.length < 101) {
|
||||
return true;
|
||||
}
|
||||
return 'Please do not use special characters and keep the rows under 100 characters each.';
|
||||
return `Please do not use special characters and keep the rows under 100 characters each, you have ${bottomrow.length}.`;
|
||||
},
|
||||
parse: text => {
|
||||
return text.replace(/[ ]/g, '-').replace(/[?]/g, '~q');
|
||||
|
||||
Reference in New Issue
Block a user