2021-08-19 14:19:14 +00:00
|
|
|
import ImageCommand from "../../classes/imageCommand.js";
|
|
|
|
import { random } from "../../utils/misc.js";
|
2022-06-07 23:26:40 +00:00
|
|
|
const names = ["esmBot", "me_irl", "dankmemes", "hmmm", "gaming", "wholesome", "chonkers", "memes", "funny", "lies"];
|
2021-04-26 14:47:03 +00:00
|
|
|
|
|
|
|
class RedditCommand extends ImageCommand {
|
2022-03-31 19:53:22 +00:00
|
|
|
params(url) {
|
2022-06-07 23:26:40 +00:00
|
|
|
const newArgs = this.options.text ?? this.args.filter(item => !item.includes(url)).join(" ");
|
2021-04-26 14:47:03 +00:00
|
|
|
return {
|
2022-07-23 21:02:04 +00:00
|
|
|
caption: newArgs?.trim() ? newArgs.replaceAll("\n", "").replaceAll(" ", "") : random(names)
|
2021-04-26 14:47:03 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-07-31 01:21:06 +00:00
|
|
|
static textOptional = true;
|
|
|
|
|
2021-04-26 14:47:03 +00:00
|
|
|
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!";
|
2021-04-26 14:47:03 +00:00
|
|
|
static command = "reddit";
|
|
|
|
}
|
|
|
|
|
2022-01-21 04:52:29 +00:00
|
|
|
export default RedditCommand;
|