2019-12-05 16:58:46 +00:00
|
|
|
const gm = require("gm").subClass({
|
|
|
|
imageMagick: true
|
|
|
|
});
|
|
|
|
|
|
|
|
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 template = "./assets/images/hbc.png";
|
2019-12-06 14:55:30 +00:00
|
|
|
const cleanedMessage = args.join(" ").toLowerCase().replace(/\n/g, " ");
|
2020-02-25 20:45:47 +00:00
|
|
|
const buffer = await gm(template).gravity("Center").font("./assets/hbc.ttf").out("-kerning", "-5").fill("white").pointSize(96).drawText(0, 0, cleanedMessage).bufferPromise("png");
|
2020-04-12 19:51:48 +00:00
|
|
|
return {
|
2020-02-19 14:25:45 +00:00
|
|
|
file: buffer,
|
2019-12-05 16:58:46 +00:00
|
|
|
name: "homebrew.png"
|
2020-04-12 19:51:48 +00:00
|
|
|
};
|
2019-12-05 16:58:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.aliases = ["hbc", "brew", "wiibrew"];
|
|
|
|
exports.category = 4;
|
2019-12-06 00:15:28 +00:00
|
|
|
exports.help = "Creates a Homebrew Channel edit";
|
|
|
|
exports.params = "[text]";
|