mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 05:51:42 +02:00
22.0.0
This commit is contained in:
+10
-8
@@ -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`] });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user