2021-08-19 14:19:14 +00:00
|
|
|
import ImageCommand from "../../classes/imageCommand.js";
|
2022-10-24 01:27:32 +00:00
|
|
|
import { cleanMessage } from "../../utils/misc.js";
|
2021-06-15 03:03:48 +00:00
|
|
|
|
|
|
|
class SnapchatCommand extends ImageCommand {
|
2021-07-14 22:23:50 +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(" ");
|
2022-06-25 03:03:34 +00:00
|
|
|
const position = parseFloat(this.options.position);
|
2021-06-15 03:03:48 +00:00
|
|
|
return {
|
2022-10-24 01:27:32 +00:00
|
|
|
caption: cleanMessage(this.message, newArgs),
|
2021-07-14 22:23:50 +00:00
|
|
|
pos: isNaN(position) ? 0.5 : position
|
2021-06-15 03:03:48 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-04-05 03:05:28 +00:00
|
|
|
static init() {
|
|
|
|
super.init();
|
|
|
|
this.flags.push({
|
|
|
|
name: "position",
|
|
|
|
type: 10,
|
|
|
|
description: "Set the position of the caption as a decimal (0.0 is top, 1.0 is bottom, default is 0.5)",
|
|
|
|
min_value: 0,
|
|
|
|
max_value: 1
|
|
|
|
});
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
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]"];
|
|
|
|
|
|
|
|
static requiresText = true;
|
|
|
|
static noText = "You need to provide some text to add a caption!";
|
2022-01-26 18:53:20 +00:00
|
|
|
static noImage = "You need to provide an image/GIF to add a caption!";
|
2021-06-15 03:03:48 +00:00
|
|
|
static command = "snapchat";
|
|
|
|
}
|
|
|
|
|
2022-01-26 18:53:20 +00:00
|
|
|
export default SnapchatCommand;
|