Nicer args parse

This commit is contained in:
Daniel Odendahl Jr
2017-04-23 23:27:03 +00:00
parent 678d3d3ae8
commit 11a610ab5e
28 changed files with 37 additions and 95 deletions
+3 -9
View File
@@ -22,9 +22,7 @@ module.exports = class MemeCommand extends Command {
}
return `${type.toLowerCase()} is not a valid meme type. Use \`x;help meme\` to view a list of types.`;
},
parse: text => {
return text.toLowerCase();
}
parse: text => text.toLowerCase()
}, {
key: 'toprow',
prompt: 'What should the top row of the meme to be?',
@@ -35,9 +33,7 @@ module.exports = class MemeCommand extends Command {
}
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');
}
parse: text => text.replace(/[ ]/g, '-').replace(/[?]/g, '~q')
}, {
key: 'bottomrow',
prompt: 'What should the bottom row of the meme to be?',
@@ -48,9 +44,7 @@ module.exports = class MemeCommand extends Command {
}
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');
}
parse: text => text.replace(/[ ]/g, '-').replace(/[?]/g, '~q')
}]
});
}