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

29 lines
797 B
JavaScript

import ImageCommand from "../../classes/imageCommand.js";
class UncaptionCommand extends ImageCommand {
constructor(client, cluster, worker, ipc, options) {
super(client, cluster, worker, ipc, options);
this.flags.push({
name: "tolerance",
type: 10,
description: "Set the shade tolerance for the caption detection (0.0 is highest, 1.0 is lowest, default is 0.95)",
min_value: 0,
max_value: 1
});
}
params() {
const tolerance = parseFloat(this.specialArgs.tolerance);
return {
tolerance: isNaN(tolerance) ? 0.95 : tolerance
};
}
static description = "Removes the caption from an image";
static noImage = "You need to provide an image/GIF to uncaption!";
static command = "uncaption";
}
export default UncaptionCommand;