Specify that image commands also work on GIFs

This commit is contained in:
Essem 2022-01-26 12:53:20 -06:00
parent afa9482ee8
commit 7248621048
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
59 changed files with 110 additions and 110 deletions

View file

@ -8,7 +8,7 @@ import imageDetect from "../../utils/imagedetect.js";
class QrReadCommand extends Command {
async run() {
const image = await imageDetect(this.client, this.message);
if (image === undefined) return "You need to provide an image with a QR code to read!";
if (image === undefined) return "You need to provide an image/GIF with a QR code to read!";
this.client.sendChannelTyping(this.message.channel.id);
const data = await (await fetch(image.path)).buffer();
const rawData = await sharp(data).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
@ -20,4 +20,4 @@ class QrReadCommand extends Command {
static description = "Reads a QR code";
}
export default QrReadCommand;
export default QrReadCommand;

View file

@ -5,7 +5,7 @@ class RawCommand extends Command {
async run() {
this.client.sendChannelTyping(this.message.channel.id);
const image = await imageDetect(this.client, this.message);
if (image === undefined) return "You need to provide an image to get a raw URL!";
if (image === undefined) return "You need to provide an image/GIF to get a raw URL!";
return image.path;
}
@ -13,4 +13,4 @@ class RawCommand extends Command {
static aliases = ["gif", "getgif", "giflink", "imglink", "getimg", "rawgif", "rawimg"];
}
export default RawCommand;
export default RawCommand;