From 26dc23f289cb0a5899984964a5d84f79becb568a Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Mon, 8 Mar 2021 17:52:42 -0500 Subject: [PATCH] Fix weird error --- commands/edit-image-text/cool-text.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/edit-image-text/cool-text.js b/commands/edit-image-text/cool-text.js index 72747df2..f8646fa6 100644 --- a/commands/edit-image-text/cool-text.js +++ b/commands/edit-image-text/cool-text.js @@ -43,7 +43,11 @@ module.exports = class CoolTextCommand extends Command { ...fonts[font], Text: text }); - return msg.say({ files: [body.renderLocation] }); + process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; + const { body: imageBody } = await request.get(body.renderLocation); + process.env.NODE_TLS_REJECT_UNAUTHORIZED = undefined; + const format = body.isAnimated ? 'gif' : 'png'; + return msg.say({ files: [{ attachment: imageBody, name: `${font}.${format}` }] }); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); }