This commit is contained in:
Dragon Fire
2021-05-23 18:27:05 -04:00
parent c64c00515f
commit a3383e4c15
+2 -1
View File
@@ -39,12 +39,13 @@ module.exports = class CoolTextCommand extends Command {
async run(msg, { font, text }) {
try {
const { body } = await request
const { body, text } = await request
.post('https://cooltext.com/PostChange')
.attach({
...fonts[font],
Text: text
});
if (!text) return msg.say('Failed to create an image with this text.');
const { body: imageBody } = await request.get(body.renderLocation, { agent: noRejectAgent });
const format = body.isAnimated ? 'gif' : 'png';
return msg.say({ files: [{ attachment: imageBody, name: `${font}.${format}` }] });