2019-11-15 16:59:50 +00:00
|
|
|
const gm = require("gm").subClass({
|
|
|
|
imageMagick: true
|
|
|
|
});
|
|
|
|
|
|
|
|
exports.run = async (message) => {
|
|
|
|
const image = await require("../utils/imagedetect.js")(message);
|
|
|
|
if (image === undefined) return `${message.author.mention}, you need to provide an image to spin!`;
|
|
|
|
const processMessage = await message.channel.createMessage("<a:processing:479351417102925854> Processing... This might take a while");
|
2020-03-15 17:54:51 +00:00
|
|
|
const resultBuffer = await gm(image.path).coalesce().out("-duplicate", "29").scale("256x256>").scale("256x256<").background("white").virtualPixel("background").out("-rotate", "%[fx:360*t/n]").set("delay", "5").set("dispose", "background").out("-loop", "0").bufferPromise("gif");
|
2019-11-15 16:59:50 +00:00
|
|
|
await processMessage.delete();
|
|
|
|
return message.channel.createMessage("", {
|
|
|
|
file: resultBuffer,
|
|
|
|
name: "spin.gif"
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2019-12-02 20:47:22 +00:00
|
|
|
exports.aliases = ["rotate"];
|
|
|
|
exports.category = 5;
|
|
|
|
exports.help = "Spins an image";
|