2020-12-11 19:52:02 +00:00
|
|
|
const magick = require("../utils/image.js");
|
|
|
|
|
|
|
|
exports.run = async (message) => {
|
|
|
|
message.channel.sendTyping();
|
|
|
|
const image = await require("../utils/imagedetect.js")(message);
|
|
|
|
if (image === undefined) return `${message.author.mention}, you need to provide a GIF to unfreeze!`;
|
|
|
|
const { buffer, type } = await magick.run({
|
|
|
|
cmd: "freeze",
|
|
|
|
path: image.path,
|
|
|
|
loop: true,
|
2021-01-05 02:53:34 +00:00
|
|
|
onlyGIF: true,
|
|
|
|
type: image.type
|
2020-12-11 19:52:02 +00:00
|
|
|
});
|
2021-01-10 01:50:29 +00:00
|
|
|
if (type === "nogif") return `${message.author.mention}, that isn't a GIF!`;
|
2020-12-11 19:52:02 +00:00
|
|
|
return {
|
|
|
|
file: buffer,
|
|
|
|
name: `unfreeze.${type}`
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.category = 5;
|
|
|
|
exports.help = "Unfreezes a GIF";
|