Added globe, Magick++ ports wave 2
This commit is contained in:
parent
617cf01090
commit
d3f46edfa6
7 changed files with 113 additions and 10 deletions
|
@ -1,13 +1,11 @@
|
|||
const gm = require("gm").subClass({
|
||||
imageMagick: true
|
||||
});
|
||||
const magick = require("../build/Release/image.node");
|
||||
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 an image to add New Funky Mode!`;
|
||||
const watermark = "./assets/images/funky.png";
|
||||
const buffer = await gm(image.path).coalesce().out("null:").out(watermark).gravity("NorthEast").scale(null, "%[fx:u.h]").out("-layers", "composite").bufferPromise(image.type, image.delay);
|
||||
const buffer = await promisify(magick.watermark)(image.path, "./assets/images/funky.png", 3, true, image.type.toUpperCase(), image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0);
|
||||
return {
|
||||
file: buffer,
|
||||
name: `funky.${image.type}`
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
const gm = require("gm").subClass({
|
||||
imageMagick: true
|
||||
});
|
||||
const magick = require("../build/Release/image.node");
|
||||
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 an image to make a GameXplain thumbnail meme!`;
|
||||
const template = "./assets/images/gamexplain.png";
|
||||
const buffer = await gm(template).background("white").out("null:").out("(").out(image.path).coalesce().out("-virtual-pixel", "transparent").scale("1181x571!").out(")").compose("over").gravity("Center").out("-geometry", "+0+40").out("-layers", "composite").bufferPromise(image.type, image.delay);
|
||||
const buffer = await promisify(magick.gamexplain)(image.path, image.type.toUpperCase(), image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0);
|
||||
return {
|
||||
file: buffer,
|
||||
name: `gamexplain.${image.type}`
|
||||
|
|
18
commands/globe.js
Normal file
18
commands/globe.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
const magick = require("../build/Release/image.node");
|
||||
const { promisify } = require("util");
|
||||
|
||||
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 promisify(magick.globe)(image.path, image.type.toUpperCase(), image.delay ? (100 / image.delay.split("/")[0]) * image.delay.split("/")[1] : 0);
|
||||
await processMessage.delete();
|
||||
return {
|
||||
file: buffer,
|
||||
name: "globe.gif"
|
||||
};
|
||||
};
|
||||
|
||||
exports.aliases = ["rotate"];
|
||||
exports.category = 5;
|
||||
exports.help = "Spins an image";
|
Loading…
Add table
Add a link
Reference in a new issue