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

24 lines
794 B
JavaScript
Raw Normal View History

2023-03-15 14:09:09 +00:00
import ImageCommand from "../../classes/imageCommand.js";
import { cleanMessage } from "../../utils/misc.js";
class WhisperCommand extends ImageCommand {
2023-03-19 05:10:48 +00:00
static category = "image-editing"
2023-03-15 14:09:09 +00:00
params(url) {
const newArgs = this.options.text ?? this.args.filter(item => !item.includes(url)).join(" ");
return {
caption: cleanMessage(this.message ?? this.interaction, newArgs)
};
}
static description = "Adds a Whisper style caption to an image";
static aliases = ["caption4"];
static arguments = ["[text]"];
static requiresText = true;
static noText = "You need to provide some text to add a caption!";
static noImage = "You need to provide an image/GIF to add a caption!";
static command = "whisper";
}
export default WhisperCommand;