mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 00:04:48 +02:00
String Changes, Don't register tons of defaults
This commit is contained in:
+10
-10
@@ -10,9 +10,9 @@ module.exports = class MemeCommand extends commando.Command {
|
||||
],
|
||||
group: 'imageedit',
|
||||
memberName: 'meme',
|
||||
description: "Sends a Meme with text of your choice, and a background of your choice. Split first and second lines with a | (;meme facepalm I can't even | comprehend this)",
|
||||
details: "**Codes:** tenguy, afraid, older, aag, tried, biw, blb, kermit, bd, ch, cbg, wonka, cb, keanu, dsm, live, ants, doge, alwaysonbeat, ermg, facepalm, fwp, fa, fbf, fry, hipster, icanhas, crazypills, mw, noidea, regret, boat, hagrid, sohappy, captain, inigo, iw, ackbar, happening, joker, ive, ll, morpheus, mb, badchoice, mmm, jetpack, red, mordor, oprah, oag, remembers, philosoraptor, jw, patrick, rollsafe, sad-obama, sad-clinton, sadfrog, sad-bush, sad-biden, sad-boehner, saltbae, sarcasticbear, dwight, sb, ss, sf, dodgson, money, sohot, nice, awesome-awkward, awesome, awkward-awesome, awkward, fetch, success, scc, ski, officespace, interesting, toohigh, bs, center, both, winter, xy, buzz, yodawg, uno, yallgot, bad, elf, chosen",
|
||||
examples: [";meme facepalm I can't even | comprehend this"],
|
||||
description: 'Sends a Meme with text of your choice, and a background of your choice. Split first and second lines with a | (;meme facepalm I can\'t even | comprehend this)',
|
||||
details: '**Codes:** tenguy, afraid, older, aag, tried, biw, blb, kermit, bd, ch, cbg, wonka, cb, keanu, dsm, live, ants, doge, alwaysonbeat, ermg, facepalm, fwp, fa, fbf, fry, hipster, icanhas, crazypills, mw, noidea, regret, boat, hagrid, sohappy, captain, inigo, iw, ackbar, happening, joker, ive, ll, morpheus, mb, badchoice, mmm, jetpack, red, mordor, oprah, oag, remembers, philosoraptor, jw, patrick, rollsafe, sad-obama, sad-clinton, sadfrog, sad-bush, sad-biden, sad-boehner, saltbae, sarcasticbear, dwight, sb, ss, sf, dodgson, money, sohot, nice, awesome-awkward, awesome, awkward-awesome, awkward, fetch, success, scc, ski, officespace, interesting, toohigh, bs, center, both, winter, xy, buzz, yodawg, uno, yallgot, bad, elf, chosen',
|
||||
examples: [';meme facepalm I can\'t even | comprehend this'],
|
||||
args: [{
|
||||
key: 'type',
|
||||
prompt: 'What meme type do you want to use?',
|
||||
@@ -25,13 +25,13 @@ module.exports = class MemeCommand extends commando.Command {
|
||||
}
|
||||
}, {
|
||||
key: 'content',
|
||||
prompt: 'What should the meme content be? Split the bottom and top text of the meme with " | ".',
|
||||
prompt: 'What should the meme content be? Split the bottom and top text of the meme with ' | '.',
|
||||
type: 'string',
|
||||
validate: content => {
|
||||
if (content.includes(' | ') && content.match(/^[a-zA-Z0-9|.,!?'-\s]+$/)) {
|
||||
return true;
|
||||
}
|
||||
return 'Please split your choices with " | " and do not use special characters.';
|
||||
return 'Please split your choices with ' | ' and do not use special characters.';
|
||||
}
|
||||
}]
|
||||
});
|
||||
@@ -44,12 +44,12 @@ module.exports = class MemeCommand extends commando.Command {
|
||||
console.log(`[Command] ${message.content}`);
|
||||
const type = args.type.toLowerCase();
|
||||
const content = args.content;
|
||||
const memeQuery = content.split(" ").join("-").split("-|-");
|
||||
const toprow = memeQuery[0].split("?").join("~q");
|
||||
const bottomrow = memeQuery[1].split("?").join("~q");
|
||||
const memeQuery = content.split(' ').join('-').split('-|-');
|
||||
const toprow = memeQuery[0].split('?').join('~q');
|
||||
const bottomrow = memeQuery[1].split('?').join('~q');
|
||||
const link = `https://memegen.link/${type}/${toprow}/${bottomrow}.jpg`;
|
||||
if (bottomrow.length > 100) return message.say(":x: Error! Bottom text is over 100 characters!");
|
||||
if (toprow.length > 100) return message.say(":x: Error! Top text is over 100 characters!");
|
||||
if (bottomrow.length > 100) return message.say(':x: Error! Bottom text is over 100 characters!');
|
||||
if (toprow.length > 100) return message.say(':x: Error! Top text is over 100 characters!');
|
||||
return message.channel.sendFile(link).catch(err => message.say(':x: Error! Something went wrong!'));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user