2021-08-19 14:19:14 +00:00
|
|
|
import Command from "../../classes/command.js";
|
|
|
|
import imageDetect from "../../utils/imagedetect.js";
|
2021-06-28 22:59:05 +00:00
|
|
|
|
2021-07-04 03:05:00 +00:00
|
|
|
class RawCommand extends Command {
|
2021-06-28 22:59:05 +00:00
|
|
|
async run() {
|
2022-04-05 03:05:28 +00:00
|
|
|
await this.acknowledge();
|
2022-03-31 05:42:03 +00:00
|
|
|
const image = await imageDetect(this.client, this.message, this.interaction, this.options);
|
2022-01-26 18:53:20 +00:00
|
|
|
if (image === undefined) return "You need to provide an image/GIF to get a raw URL!";
|
2021-06-28 22:59:05 +00:00
|
|
|
return image.path;
|
|
|
|
}
|
|
|
|
|
2021-07-04 03:05:00 +00:00
|
|
|
static description = "Gets a direct image URL (useful for saving GIFs from sites like Tenor)";
|
|
|
|
static aliases = ["gif", "getgif", "giflink", "imglink", "getimg", "rawgif", "rawimg"];
|
2022-03-31 05:42:03 +00:00
|
|
|
static flags = [{
|
|
|
|
name: "image",
|
|
|
|
type: 11,
|
|
|
|
description: "An image/GIF attachment"
|
|
|
|
}, {
|
|
|
|
name: "link",
|
|
|
|
type: 3,
|
|
|
|
description: "An image/GIF URL"
|
|
|
|
}];
|
2021-06-28 22:59:05 +00:00
|
|
|
}
|
|
|
|
|
2022-01-26 18:53:20 +00:00
|
|
|
export default RawCommand;
|