mrmBot-Matrix/commands/general/raw.js

30 lines
878 B
JavaScript
Raw Normal View History

2023-03-15 14:09:09 +00:00
import Command from "../../classes/command.js";
import imageDetect from "../../utils/imagedetect.js";
class RawCommand extends Command {
2023-03-19 05:10:48 +00:00
static category = "general"
2023-03-15 14:09:09 +00:00
async run() {
2023-03-17 00:23:01 +00:00
// await this.acknowledge();
2023-03-15 14:09:09 +00:00
const image = await imageDetect(this.client, this.message, this.interaction, this.options);
if (image === undefined) {
this.success = false;
return "You need to provide an image/GIF to get a raw URL!";
}
return image.path;
}
static description = "Gets a direct image URL (useful for saving GIFs from sites like Tenor)";
static aliases = ["giflink", "imglink", "getimg", "rawgif", "rawimg"];
static flags = [{
name: "image",
type: 11,
description: "An image/GIF attachment"
}, {
name: "link",
type: 3,
description: "An image/GIF URL"
}];
}
export default RawCommand;