Added case special arg to meme, added new playing messages

This commit is contained in:
Essem 2021-10-29 22:48:50 -05:00
parent 1cf53f9584
commit fa14ce7c35
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
2 changed files with 10 additions and 5 deletions

View file

@ -5,13 +5,17 @@ class MemeCommand extends ImageCommand {
const newArgs = this.args.filter(item => !item.includes(url)); const newArgs = this.args.filter(item => !item.includes(url));
const [topText, bottomText] = newArgs.join(" ").split(/(?<!\\),/).map(elem => elem.trim()); const [topText, bottomText] = newArgs.join(" ").split(/(?<!\\),/).map(elem => elem.trim());
return { return {
top: topText.toUpperCase().replaceAll("&", "\\&amp;").replaceAll(">", "\\&gt;").replaceAll("<", "\\&lt;").replaceAll("\"", "\\&quot;").replaceAll("'", "\\&apos;").replaceAll("%", "\\%"), top: (this.specialArgs.case ? topText : topText.toUpperCase()).replaceAll("&", "\\&amp;").replaceAll(">", "\\&gt;").replaceAll("<", "\\&lt;").replaceAll("\"", "\\&quot;").replaceAll("'", "\\&apos;").replaceAll("%", "\\%"),
bottom: bottomText ? bottomText.toUpperCase().replaceAll("&", "\\&amp;").replaceAll(">", "\\&gt;").replaceAll("<", "\\&lt;").replaceAll("\"", "\\&quot;").replaceAll("'", "\\&apos;").replaceAll("%", "\\%") : "" bottom: bottomText ? (this.specialArgs.case ? bottomText : bottomText.toUpperCase()).replaceAll("&", "\\&amp;").replaceAll(">", "\\&gt;").replaceAll("<", "\\&lt;").replaceAll("\"", "\\&quot;").replaceAll("'", "\\&apos;").replaceAll("%", "\\%") : ""
}; };
} }
static description = "Generates a meme from an image (separate top/bottom text with a comma)"; static description = "Generates a meme from an image (separate top/bottom text with a comma)";
static arguments = ["[top text]", "{bottom text}"]; static arguments = ["[top text]", "{bottom text}"];
static flags = [{
name: "case",
description: "Make the meme text case-sensitive (allows for lowercase text)"
}];
static requiresText = true; static requiresText = true;
static noText = "You need to provide some text to generate a meme!"; static noText = "You need to provide some text to generate a meme!";

View file

@ -138,15 +138,16 @@
"WhatsApp", "WhatsApp",
"Half Life 3", "Half Life 3",
"Tower Defense Simulator", "Tower Defense Simulator",
"roblox on linux 2021",
"trans rights", "trans rights",
"balls", "balls",
"Vivaldi", "Vivaldi",
"Space Channel 5: Part 2", "Space Channel 5: Part 2",
"Vib Ribbon", "Vib Ribbon",
"[Hyperlink Blocked]", "[[Hyperlink Blocked]]",
"Steam Deck", "Steam Deck",
"Something big is coming.", "Something big is coming.",
"This image has expired." "This image has expired.",
"The GIF File Format",
"The clock is ticking."
] ]
} }