Make log files rotate, clean up separated text input, add more uncanny images, use a more reliable method to get the instance owner username
This commit is contained in:
parent
b0f4c16d50
commit
4265e3e914
22 changed files with 128 additions and 88 deletions
|
@ -1,11 +1,9 @@
|
|||
import ImageCommand from "../../classes/imageCommand.js";
|
||||
|
||||
class GrayscaleCommand extends ImageCommand {
|
||||
params() {
|
||||
return {
|
||||
color: "grayscale"
|
||||
};
|
||||
}
|
||||
params = {
|
||||
color: "grayscale"
|
||||
};
|
||||
|
||||
static description = "Adds a grayscale filter";
|
||||
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
import ImageCommand from "../../classes/imageCommand.js";
|
||||
|
||||
class MemeCommand extends ImageCommand {
|
||||
async criteria(text, url) {
|
||||
const [topText, bottomText] = text.replaceAll(url, "").split(/(?<!\\),/).map(elem => elem.trim());
|
||||
if (topText === "" && bottomText === "") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
params(url) {
|
||||
const newArgs = this.options.text ?? this.args.filter(item => !item.includes(url)).join(" ");
|
||||
const [topText, bottomText] = newArgs.split(/(?<!\\),/).map(elem => elem.trim());
|
||||
const newArgs = this.options.text ?? this.args.join(" ");
|
||||
const [topText, bottomText] = newArgs.replaceAll(url, "").split(/(?<!\\),/).map(elem => elem.trim());
|
||||
return {
|
||||
top: (this.options.case ? topText : topText.toUpperCase()).replaceAll("&", "&").replaceAll(">", ">").replaceAll("<", "<").replaceAll("\"", """).replaceAll("'", "'").replaceAll("\\n", "\n"),
|
||||
bottom: bottomText ? (this.options.case ? bottomText : bottomText.toUpperCase()).replaceAll("&", "&").replaceAll(">", ">").replaceAll("<", "<").replaceAll("\"", """).replaceAll("'", "'").replaceAll("\\n", "\n") : "",
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
import ImageCommand from "../../classes/imageCommand.js";
|
||||
|
||||
class MotivateCommand extends ImageCommand {
|
||||
async criteria(text, url) {
|
||||
const [topText, bottomText] = text.replaceAll(url, "").split(/(?<!\\),/).map(elem => elem.trim());
|
||||
if (topText === "" && bottomText === "") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
params(url) {
|
||||
const newArgs = this.options.text ?? this.args.filter(item => !item.includes(url)).join(" ");
|
||||
const [topText, bottomText] = newArgs.split(/(?<!\\),/).map(elem => elem.trim());
|
||||
const newArgs = this.options.text ?? this.args.join(" ");
|
||||
const [topText, bottomText] = newArgs.replaceAll(url, "").split(/(?<!\\),/).map(elem => elem.trim());
|
||||
return {
|
||||
top: topText.replaceAll("&", "&").replaceAll(">", ">").replaceAll("<", "<").replaceAll("\"", """).replaceAll("'", "'").replaceAll("\\n", "\n"),
|
||||
bottom: bottomText ? bottomText.replaceAll("&", "&").replaceAll(">", ">").replaceAll("<", "<").replaceAll("\"", """).replaceAll("'", "'").replaceAll("\\n", "\n") : "",
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import ImageCommand from "../../classes/imageCommand.js";
|
||||
|
||||
class SepiaCommand extends ImageCommand {
|
||||
params() {
|
||||
return {
|
||||
color: "sepia"
|
||||
};
|
||||
}
|
||||
params = {
|
||||
color: "sepia"
|
||||
};
|
||||
|
||||
static description = "Adds a sepia filter";
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import ImageCommand from "../../classes/imageCommand.js";
|
||||
|
||||
class SooSCommand extends ImageCommand {
|
||||
params() {
|
||||
return {
|
||||
soos: true
|
||||
};
|
||||
}
|
||||
params = {
|
||||
soos: true
|
||||
};
|
||||
|
||||
static description = "\"Loops\" an image sequence by reversing it when it's finished";
|
||||
static aliases = ["bounce", "boomerang"];
|
||||
|
|
|
@ -10,9 +10,9 @@ const names = readdirSync(resolve(dirname(fileURLToPath(import.meta.url)), "../.
|
|||
|
||||
class UncannyCommand extends ImageCommand {
|
||||
params(url, name = "unknown") {
|
||||
const newArgs = this.options.text ?? this.args.filter(item => !item.includes(url)).join(" ");
|
||||
const newArgs = this.options.text ?? this.args.join(" ");
|
||||
// eslint-disable-next-line prefer-const
|
||||
let [text1, text2] = newArgs.split(/(?<!\\),/).map(elem => elem.trim());
|
||||
let [text1, text2] = newArgs.replaceAll(url, "").split(/(?<!\\),/).map(elem => elem.trim());
|
||||
if (!text2?.trim()) text2 = name;
|
||||
return {
|
||||
caption: text1?.trim() ? text1.replaceAll("&", "&").replaceAll(">", ">").replaceAll("<", "<").replaceAll("\"", """).replaceAll("'", "'").replaceAll("\\n", "\n") : random(prompts),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue