mrmBot-Matrix/commands/image-editing/reddit.js

21 lines
806 B
JavaScript
Raw Normal View History

import ImageCommand from "../../classes/imageCommand.js";
import { random } from "../../utils/misc.js";
const names = ["esmBot", "me_irl", "dankmemes", "hmmm", "gaming", "wholesome", "chonkers", "memes", "funny", "pcmasterrace", "thomastheplankengine"];
class RedditCommand extends ImageCommand {
2022-03-31 19:53:22 +00:00
params(url) {
const newArgs = this.type === "classic" ? this.args.filter(item => !item.includes(url)).join(" ") : this.options.text;
return {
2022-03-31 19:53:22 +00:00
caption: newArgs && newArgs.trim() ? newArgs.replaceAll("\n", "").replaceAll(" ", "") : random(names)
};
}
static description = "Adds a Reddit watermark to an image";
static arguments = ["{text}"];
2021-05-24 19:31:44 +00:00
static noText = "You need to provide some text to add a Reddit watermark!";
static command = "reddit";
}
export default RedditCommand;