Added slow
This commit is contained in:
parent
2823fb2fd3
commit
12abe9156d
1 changed files with 21 additions and 0 deletions
21
commands/slow.js
Normal file
21
commands/slow.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
const gm = require("gm").subClass({
|
||||
imageMagick: true
|
||||
});
|
||||
|
||||
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 slow down!`;
|
||||
if (image.type !== "gif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
const value = await gm(image.path).identifyPromise();
|
||||
const delay = value.Delay ? value.Delay[0].split("x") : [0, 100];
|
||||
const buffer = await gm().delay(`${parseInt(delay[0]) * 2}x${delay[1]}`).out(image.path).bufferPromise(image.type, image.delay);
|
||||
return message.channel.createMessage("", {
|
||||
file: buffer,
|
||||
name: "slow.gif"
|
||||
});
|
||||
};
|
||||
|
||||
exports.aliases = ["slowdown", "slower", "gifspeed2"];
|
||||
exports.category = 5;
|
||||
exports.help = "Makes a GIF slower";
|
Loading…
Reference in a new issue