Added tolerance option to uncaption, fixed nogif return type

This commit is contained in:
Essem 2022-02-17 08:46:02 -06:00
parent a82ae115f8
commit ec6fb7de37
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
4 changed files with 19 additions and 3 deletions

View file

@ -16,7 +16,7 @@ class SnapchatCommand extends ImageCommand {
static flags = [{
name: "position",
type: "number",
description: "Set the position of the caption as a decimal (0.0 is top, 1.0 is bottom)"
description: "Set the position of the caption as a decimal (0.0 is top, 1.0 is bottom, default is 0.5)"
}];
static requiresText = true;

View file

@ -1,7 +1,19 @@
import ImageCommand from "../../classes/imageCommand.js";
class UncaptionCommand extends ImageCommand {
params() {
const tolerance = parseFloat(this.specialArgs.tolerance);
return {
tolerance: isNaN(tolerance) ? 0.95 : tolerance
};
}
static description = "Removes the caption from an image";
static flags = [{
name: "tolerance",
type: "number",
description: "Set the shade tolerance for the caption detection (0.0 is highest, 1.0 is lowest, default is 0.95)"
}];
static noImage = "You need to provide an image/GIF to uncaption!";
static command = "uncaption";