2021-06-15 03:03:48 +00:00
|
|
|
const ImageCommand = require("../../classes/imageCommand.js");
|
|
|
|
|
|
|
|
class SnapchatCommand extends ImageCommand {
|
2021-07-14 22:23:50 +00:00
|
|
|
params(url) {
|
|
|
|
const newArgs = this.args.filter(item => !item.includes(url));
|
|
|
|
const position = parseFloat(this.specialArgs.position);
|
2021-06-15 03:03:48 +00:00
|
|
|
return {
|
2021-07-14 22:23:50 +00:00
|
|
|
caption: newArgs.join(" ").replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%"),
|
|
|
|
pos: isNaN(position) ? 0.5 : position
|
2021-06-15 03:03:48 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
static description = "Adds a Snapchat style caption to an image";
|
|
|
|
static aliases = ["snap", "caption3"];
|
|
|
|
static arguments = ["[text]"];
|
2021-07-14 22:23:50 +00:00
|
|
|
static flags = [{
|
|
|
|
name: "position",
|
|
|
|
type: "number",
|
|
|
|
description: "Set the position of the caption as a decimal (0.0 is top, 1.0 is bottom)"
|
|
|
|
}];
|
2021-06-15 03:03:48 +00:00
|
|
|
|
|
|
|
static requiresText = true;
|
|
|
|
static noText = "You need to provide some text to add a caption!";
|
|
|
|
static noImage = "You need to provide an image to add a caption!";
|
|
|
|
static command = "snapchat";
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = SnapchatCommand;
|