Fix reddit slash command text input, make filename detection split on last period

This commit is contained in:
Essem 2022-07-30 20:21:06 -05:00
parent f3eea0d96a
commit b0f4c16d50
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
4 changed files with 8 additions and 3 deletions

View file

@ -10,6 +10,8 @@ class RedditCommand extends ImageCommand {
};
}
static textOptional = true;
static description = "Adds a Reddit watermark to an image";
static arguments = ["{text}"];

View file

@ -17,7 +17,7 @@ class UncannyCommand extends ImageCommand {
return {
caption: text1?.trim() ? text1.replaceAll("&", "&amp;").replaceAll(">", "&gt;").replaceAll("<", "&lt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;").replaceAll("\\n", "\n") : random(prompts),
caption2: text2.replaceAll("&", "&amp;").replaceAll(">", "&gt;").replaceAll("<", "&lt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;").replaceAll("\\n", "\n"),
path: `./assets/images/uncanny/${typeof this.options.phase === "string" && names.includes(this.options.phase.toLowerCase()) ? this.options.phase.toLowerCase() : random(names)}.png`,
path: `./assets/images/uncanny/${typeof this.options.phase === "string" && names.includes(this.options.phase.toLowerCase()) ? this.options.phase.toLowerCase() : random(names.filter((val) => val !== "goated"))}.png`,
font: typeof this.options.font === "string" && this.constructor.allowedFonts.includes(this.options.font.toLowerCase()) ? this.options.font.toLowerCase() : "helvetica"
};
}
@ -50,6 +50,8 @@ class UncannyCommand extends ImageCommand {
return this;
}
static textOptional = true;
static description = "Makes a Mr. Incredible Becomes Uncanny image (separate left/right text with a comma)";
static aliases = ["canny", "incredible", "pain"];
static arguments = ["{left text}", "{right text}"];