2020-08-28 02:34:12 +00:00
|
|
|
const magick = require("../utils/image.js");
|
2019-09-13 20:02:41 +00:00
|
|
|
const wrap = require("../utils/wrap.js");
|
|
|
|
|
|
|
|
exports.run = async (message, args) => {
|
2019-12-02 20:47:22 +00:00
|
|
|
if (args.length === 0) return `${message.author.mention}, you need to provide some text to make a Sonic meme!`;
|
2019-09-13 20:02:41 +00:00
|
|
|
message.channel.sendTyping();
|
2021-01-18 20:11:28 +00:00
|
|
|
const cleanedMessage = args.join(" ").replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%");
|
2020-12-30 17:37:41 +00:00
|
|
|
const { buffer } = await magick.run({
|
2020-08-28 02:34:12 +00:00
|
|
|
cmd: "sonic",
|
|
|
|
text: wrap(cleanedMessage, {width: 15, indent: ""})
|
|
|
|
});
|
2020-04-12 19:51:48 +00:00
|
|
|
return {
|
2020-02-21 00:26:49 +00:00
|
|
|
file: buffer,
|
|
|
|
name: "sonic.png"
|
2020-04-12 19:51:48 +00:00
|
|
|
};
|
2019-12-02 20:47:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.category = 4;
|
2019-12-05 16:58:46 +00:00
|
|
|
exports.help = "Creates a Sonic speech bubble image";
|
|
|
|
exports.params = "[text]";
|