Specify that image commands also work on GIFs
This commit is contained in:
parent
afa9482ee8
commit
7248621048
59 changed files with 110 additions and 110 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue