Heavy work on the image detection code, fixed mention prefixes not being properly registered

This commit is contained in:
TheEssem 2020-10-18 16:53:35 -05:00
parent 6cd9878632
commit cf5c649384
57 changed files with 240 additions and 443 deletions

View file

@ -4,17 +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 an image to add a 9GAG watermark!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "watermark",
path: image.path,
water: "./assets/images/9gag.png",
gravity: 6,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
gravity: 6
});
return {
file: buffer,
name: `9gag.${image.type}`
name: `9gag.${type}`
};
};

View file

@ -4,18 +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 an image to add a Bandicam watermark!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "watermark",
path: image.path,
water: "./assets/images/bandicam.png",
gravity: 2,
resize: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
resize: true
});
return {
file: buffer,
name: `bandicam.${image.type}`
name: `bandicam.${type}`
};
};

View file

@ -4,16 +4,14 @@ 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 an image to blur!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "blur",
path: image.path,
sharp: false,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
sharp: false
});
return {
file: buffer,
name: `blur.${image.type}`
name: `blur.${type}`
};
};

View file

@ -4,15 +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 an image to make blurple!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "blurple",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `blurple.${image.type}`
name: `blurple.${type}`
};
};

View file

@ -6,17 +6,15 @@ exports.run = async (message, args) => {
const newArgs = args.filter(item => !item.includes(image.url) );
if (args.length === 0) return `${message.author.mention}, you need to provide some text to add a caption!`;
const processMessage = await message.channel.createMessage("<a:processing:479351417102925854> Processing... This might take a while");
const outputFinal = await magick.run({
const { buffer, type } = await magick.run({
cmd: "caption",
path: image.path,
caption: newArgs.join(" "),
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
caption: newArgs.join(" ")
});
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
return {
file: outputFinal,
name: `caption.${image.type}`
file: buffer,
name: `caption.${type}`
};
};

View file

@ -6,17 +6,15 @@ exports.run = async (message, args) => {
if (image === undefined) return `${message.author.mention}, you need to provide an image/GIF to add a caption!`;
const newArgs = args.filter(item => !item.includes(image.url) );
const processMessage = await message.channel.createMessage("<a:processing:479351417102925854> Processing... This might take a while");
const outputFinal = await magick.run({
const { buffer, type } = await magick.run({
cmd: "captionTwo",
path: image.path,
caption: newArgs.length !== 0 ? newArgs.join(" ") : words.sort(() => 0.5 - Math.random()).slice(0, Math.floor(Math.random() * words.length + 1)).join(" "),
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
caption: newArgs.length !== 0 ? newArgs.join(" ") : words.sort(() => 0.5 - Math.random()).slice(0, Math.floor(Math.random() * words.length + 1)).join(" ")
});
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
return {
file: outputFinal,
name: `caption2.${image.type}`
file: buffer,
name: `caption2.${type}`
};
};

View file

@ -4,15 +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 an image to add radial blur!`;
const buffer = await magick.run({
const { buffer, type} = await magick.run({
cmd: "circle",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `circle.${image.type}`
name: `circle.${type}`
};
};

View file

@ -4,15 +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 an image to crop!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "crop",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `crop.${image.type}`
name: `crop.${type}`
};
};

View file

@ -4,18 +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 an image to add a DeviantArt watermark!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "watermark",
path: image.path,
water: "./assets/images/deviantart.png",
gravity: 5,
resize: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
resize: true
});
return {
file: buffer,
name: `deviantart.${image.type}`
name: `deviantart.${type}`
};
};

View file

@ -4,16 +4,14 @@ 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 an image to explode!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "explode",
path: image.path,
amount: -1,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
amount: -1
});
return {
file: buffer,
name: `explode.${image.type}`
name: `explode.${type}`
};
};

View file

@ -19,16 +19,14 @@ exports.run = async (message, args) => {
} catch (e) {
return `${message.author.mention}, that isn't a flag!`;
}
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "flag",
path: image.path,
overlay: path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
overlay: path
});
return {
file: buffer,
name: `flag.${image.type}`
name: `flag.${type}`
};
};

View file

@ -4,15 +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 an image to flip!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "flip",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `flip.${image.type}`
name: `flip.${type}`
};
};

View file

@ -4,16 +4,14 @@ 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 an image to flop!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "flip",
path: image.path,
flop: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
flop: true
});
return {
file: buffer,
name: `flop.${image.type}`
name: `flop.${type}`
};
};

View file

@ -5,16 +5,14 @@ exports.run = async (message) => {
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 = await magick.run({
const { buffer, type } = await magick.run({
cmd: "freeze",
path: image.path,
loop: false,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
loop: false
});
return {
file: buffer,
name: `freeze.${image.type}`
name: `freeze.${type}`
};
};

View file

@ -4,18 +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 an image to add New Funky Mode!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "watermark",
path: image.path,
water: "./assets/images/funky.png",
gravity: 3,
resize: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
resize: true
});
return {
file: buffer,
name: `funky.${image.type}`
name: `funky.${type}`
};
};

View file

@ -4,15 +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 an image to make a GameXplain thumbnail meme!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "gamexplain",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `gamexplain.${image.type}`
name: `gamexplain.${type}`
};
};

View file

@ -4,11 +4,9 @@ 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");
const buffer = await magick.run({
const { buffer } = await magick.run({
cmd: "globe",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
return {

View file

@ -4,16 +4,14 @@ 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 an image to mirror!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "mirror",
path: image.path,
first: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
first: true
});
return {
file: buffer,
name: `haah.${image.type}`
name: `haah.${type}`
};
};

View file

@ -3,7 +3,7 @@ const magick = require("../utils/image.js");
exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to provide some text to make a Homebrew Channel edit!`;
message.channel.sendTyping();
const buffer = await magick.run({
const { buffer } = await magick.run({
cmd: "homebrew",
caption: args.join(" ").toLowerCase().replace(/\n/g, " ")
});

View file

@ -4,16 +4,14 @@ 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 an image to mirror!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "mirror",
path: image.path,
vertical: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
vertical: true
});
return {
file: buffer,
name: `hooh.${image.type}`
name: `hooh.${type}`
};
};

View file

@ -4,18 +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 an image to add a Hypercam watermark!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "watermark",
path: image.path,
water: "./assets/images/hypercam.png",
gravity: 1,
resize: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
resize: true
});
return {
file: buffer,
name: `hypercam.${image.type}`
name: `hypercam.${type}`
};
};

View file

@ -4,19 +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 an image to add a iFunny watermark!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "watermark",
path: image.path,
water: "./assets/images/ifunny.png",
gravity: 8,
resize: true,
append: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
append: true
});
return {
file: buffer,
name: `ifunny.${image.type}`
name: `ifunny.${type}`
};
};

View file

@ -4,16 +4,14 @@ 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 an image to implode!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "explode",
path: image.path,
amount: 1,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
amount: 1
});
return {
file: buffer,
name: `implode.${image.type}`
name: `implode.${type}`
};
};

View file

@ -4,15 +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 an image to invert!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "invert",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `invert.${image.type}`
name: `invert.${type}`
};
};

View file

@ -4,7 +4,7 @@ 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 an image to add more JPEG!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "jpeg",
path: image.path
});

View file

@ -4,15 +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 an image to make a Super Smash Bros. leak meme!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "leak",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `leak.${image.type}`
name: `leak.${type}`
};
};

View file

@ -5,16 +5,14 @@ exports.run = async (message) => {
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 = await magick.run({
const { buffer, type } = await magick.run({
cmd: "freeze",
path: image.path,
loop: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
loop: true
});
return {
file: buffer,
name: `loop.${image.type}`
name: `loop.${type}`
};
};

View file

@ -4,16 +4,14 @@ 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 add some magik!`;
const processMessage = await message.channel.createMessage("<a:processing:479351417102925854> Processing... This might take a while");
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "magik",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
return {
file: buffer,
name: `magik.${image.type}`
name: `magik.${type}`
};
};

View file

@ -7,17 +7,15 @@ exports.run = async (message, args) => {
const newArgs = args.filter(item => !item.includes(image.url) );
if (args.length === 0) return `${message.author.mention}, you need to provide some text to generate a meme!`;
const [topText, bottomText] = newArgs.join(" ").split(/(?<!\\),/).map(elem => elem.trim());
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "meme",
path: image.path,
top: topText.toUpperCase().replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;"),
bottom: bottomText ? bottomText.toUpperCase().replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;") : "",
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
bottom: bottomText ? bottomText.toUpperCase().replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;") : ""
});
return {
file: buffer,
name: `meme.${image.type}`
name: `meme.${type}`
};
};

View file

@ -4,18 +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 an image to add a MemeCenter watermark!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "watermark",
path: image.path,
water: "./assets/images/memecenter.png",
gravity: 9,
mc: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
mc: true
});
return {
file: buffer,
name: `memecenter.${image.type}`
name: `memecenter.${type}`
};
};

View file

@ -7,18 +7,16 @@ exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to provide some text to make a motivational poster!`;
const processMessage = await message.channel.createMessage("<a:processing:479351417102925854> Processing... This might take a while");
const [topText, bottomText] = newArgs.join(" ").split(/(?<!\\),/).map(elem => elem.trim());
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "motivate",
path: image.path,
top: topText.replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;"),
bottom: bottomText ? bottomText.replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;") : "",
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
bottom: bottomText ? bottomText.replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;") : ""
});
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
return {
file: buffer,
name: `motivate.${image.type}`
name: `motivate.${type}`
};
};

View file

@ -4,15 +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 an image to pixelate!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "resize",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `pixelate.${image.type}`
name: `pixelate.${type}`
};
};

View file

@ -5,7 +5,7 @@ exports.run = async (message) => {
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 = await magick.run({
const { buffer, type } = await magick.run({
cmd: "reverse",
path: image.path,
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0

View file

@ -4,15 +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 an image to make a Scott the Woz TV meme!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "scott",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `scott.${image.type}`
name: `scott.${type}`
};
};

View file

@ -4,16 +4,14 @@ 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 an image to sharpen!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "sharpen",
path: image.path,
sharp: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
sharp: true
});
return {
file: buffer,
name: `sharpen.${image.type}`
name: `sharpen.${type}`
};
};

View file

@ -4,18 +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 an image to add a Shutterstock watermark!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "watermark",
path: image.path,
water: "./assets/images/shutterstock.png",
gravity: 5,
resize: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
resize: true
});
return {
file: buffer,
name: `shutterstock.${image.type}`
name: `shutterstock.${type}`
};
};

View file

@ -6,12 +6,10 @@ exports.run = async (message) => {
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 = await magick.run({
const { buffer, type } = await magick.run({
cmd: "speed",
path: image.path,
slow: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
slow: true
});
return {
file: buffer,

View file

@ -5,7 +5,7 @@ exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to provide some text to make a Sonic meme!`;
message.channel.sendTyping();
const cleanedMessage = args.join(" ").replace(/&/g, "\\&amp;").replace(/>/g, "\\&gt;").replace(/</g, "\\&lt;").replace(/"/g, "\\&quot;").replace(/'/g, "\\&apos;");
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "sonic",
text: wrap(cleanedMessage, {width: 15, indent: ""})
});

View file

@ -5,7 +5,7 @@ exports.run = async (message) => {
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 = await magick.run({
const { buffer, type } = await magick.run({
cmd: "reverse",
path: image.path,
soos: true,

View file

@ -5,11 +5,9 @@ exports.run = async (message) => {
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 = await magick.run({
const { buffer, type } = await magick.run({
cmd: "speed",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,

View file

@ -4,11 +4,9 @@ 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");
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "spin",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
if (processMessage.channel.messages.get(processMessage.id)) await processMessage.delete();
return {

View file

@ -4,16 +4,14 @@ 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 an image to stretch!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "resize",
path: image.path,
stretch: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
stretch: true
});
return {
file: buffer,
name: `stretch.${image.type}`
name: `stretch.${type}`
};
};

View file

@ -4,15 +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 an image to swirl!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "swirl",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `swirl.${image.type}`
name: `swirl.${type}`
};
};

View file

@ -4,15 +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 an image to tile!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "tile",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `tile.${image.type}`
name: `tile.${type}`
};
};

View file

@ -4,15 +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 an image to make a Trump meme!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "trump",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `trump.${image.type}`
name: `trump.${type}`
};
};

View file

@ -4,15 +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 an image to mirror!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "mirror",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `waaw.${image.type}`
name: `waaw.${type}`
};
};

View file

@ -4,15 +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 an image to make a wall from!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "wall",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `wall.${image.type}`
name: `wall.${type}`
};
};

View file

@ -4,15 +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 an image to make a "who did this" meme!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "wdt",
path: image.path,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
path: image.path
});
return {
file: buffer,
name: `wdt.${image.type}`
name: `wdt.${type}`
};
};

View file

@ -4,16 +4,14 @@ 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 an image to stretch!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "resize",
path: image.path,
wide: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
wide: true
});
return {
file: buffer,
name: `wide.${image.type}`
name: `wide.${type}`
};
};

View file

@ -4,17 +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 an image to mirror!`;
const buffer = await magick.run({
const { buffer, type } = await magick.run({
cmd: "mirror",
path: image.path,
vertical: true,
first: true,
type: image.type.toUpperCase(),
delay: image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0
first: true
});
return {
file: buffer,
name: `woow.${image.type}`
name: `woow.${type}`
};
};