mrmBot-Matrix/commands/speed.js

21 lines
647 B
JavaScript
Raw Normal View History

const magick = require("../utils/image.js");
2020-02-13 19:29:42 +00:00
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 speed up!`;
const { buffer, type } = await magick.run({
cmd: "speed",
2020-10-20 01:24:53 +00:00
path: image.path,
onlyGIF: true
});
2020-10-20 01:24:53 +00:00
if (buffer === "nogif") return `${message.author.mention}, that isn't a GIF!`;
2020-07-23 00:54:58 +00:00
return {
file: buffer,
2020-10-20 01:24:53 +00:00
name: `speed.${type}`
2020-07-23 00:54:58 +00:00
};
2020-02-13 19:29:42 +00:00
};
exports.aliases = ["speedup", "fast", "gifspeed"];
exports.category = 5;
exports.help = "Makes a GIF faster";