Fixed GIF commands for real (lol)
This commit is contained in:
parent
5e34e45ac4
commit
a03d3a5e79
9 changed files with 35 additions and 20 deletions
|
@ -4,12 +4,13 @@ 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 freeze!`;
|
||||
if (image.type !== "gif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
const { buffer, type } = await magick.run({
|
||||
cmd: "freeze",
|
||||
path: image.path,
|
||||
loop: false
|
||||
loop: false,
|
||||
onlyGIF: true
|
||||
});
|
||||
if (buffer === "nogif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
return {
|
||||
file: buffer,
|
||||
name: `freeze.${type}`
|
||||
|
|
|
@ -4,12 +4,13 @@ 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 loop!`;
|
||||
if (image.type !== "gif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
const { buffer, type } = await magick.run({
|
||||
cmd: "freeze",
|
||||
path: image.path,
|
||||
loop: true
|
||||
loop: true,
|
||||
onlyGIF: true
|
||||
});
|
||||
if (buffer === "nogif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
return {
|
||||
file: buffer,
|
||||
name: `loop.${type}`
|
||||
|
|
|
@ -4,15 +4,16 @@ 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 reverse!`;
|
||||
if (image.type !== "gif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
const { buffer, type } = await magick.run({
|
||||
cmd: "reverse",
|
||||
path: image.path,
|
||||
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
|
||||
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0,
|
||||
onlyGIF: true
|
||||
});
|
||||
if (buffer === "nogif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
return {
|
||||
file: buffer,
|
||||
name: "reverse.gif"
|
||||
name: `reverse.${type}`
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
const magick = require("../utils/image.js");
|
||||
const { promisify } = require("util");
|
||||
|
||||
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 { buffer, type } = await magick.run({
|
||||
cmd: "speed",
|
||||
path: image.path,
|
||||
slow: true
|
||||
slow: true,
|
||||
onlyGIF: true
|
||||
});
|
||||
if (buffer === "nogif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
return {
|
||||
file: buffer,
|
||||
name: "slow.gif"
|
||||
name: `slow.${type}`
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,16 +4,17 @@ 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 loop!`;
|
||||
if (image.type !== "gif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
const { buffer, type } = await magick.run({
|
||||
cmd: "reverse",
|
||||
path: image.path,
|
||||
soos: true,
|
||||
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
|
||||
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0,
|
||||
onlyGIF: true
|
||||
});
|
||||
if (buffer === "nogif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
return {
|
||||
file: buffer,
|
||||
name: "soos.gif"
|
||||
name: `soos.${type}`
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -4,14 +4,15 @@ 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!`;
|
||||
if (image.type !== "gif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
const { buffer, type } = await magick.run({
|
||||
cmd: "speed",
|
||||
path: image.path
|
||||
path: image.path,
|
||||
onlyGIF: true
|
||||
});
|
||||
if (buffer === "nogif") return `${message.author.mention}, that isn't a GIF!`;
|
||||
return {
|
||||
file: buffer,
|
||||
name: "speed.gif"
|
||||
name: `speed.${type}`
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue