This commit is contained in:
Daniel Odendahl Jr
2017-06-01 08:44:02 +00:00
parent 7802bb49cb
commit 14f85f94bd
129 changed files with 1915 additions and 1720 deletions
+10 -8
View File
@@ -15,23 +15,26 @@ module.exports = class MemeCommand extends Command {
key: 'type',
prompt: 'What meme type do you want to use?',
type: 'string',
validate: type => {
if (codes.includes(type.toLowerCase())) return true;
return 'Invalid meme type. Use `help meme` to view a list of meme types.';
validate: (type) => {
if (codes.includes(type.toLowerCase())) {
return true;
} else {
return 'Invalid meme type. Use `help meme` to view a list of meme types.';
}
},
parse: type => type.toLowerCase()
parse: (type) => type.toLowerCase()
},
{
key: 'top',
prompt: 'What should the top row of the meme to be?',
type: 'string',
parse: top => encodeURIComponent(top.replace(/[ ]/g, '-'))
parse: (top) => encodeURIComponent(top.replace(/[ ]/g, '-'))
},
{
key: 'bottom',
prompt: 'What should the bottom row of the meme to be?',
type: 'string',
parse: bottom => encodeURIComponent(bottom.replace(/[ ]/g, '-'))
parse: (bottom) => encodeURIComponent(bottom.replace(/[ ]/g, '-'))
}
]
});
@@ -39,7 +42,6 @@ module.exports = class MemeCommand extends Command {
run(msg, args) {
const { type, top, bottom } = args;
return msg.say({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] })
.catch(err => msg.say(`${err.name}: ${err.message}`));
return msg.say({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] });
}
};