From c64c00515f5c75916c664786c49da0c74e54188c Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 23 May 2021 18:25:09 -0400 Subject: [PATCH] Use agent for cooltext no-reject --- commands/edit-image-text/cool-text.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/edit-image-text/cool-text.js b/commands/edit-image-text/cool-text.js index f8646fa6..f61ee43e 100644 --- a/commands/edit-image-text/cool-text.js +++ b/commands/edit-image-text/cool-text.js @@ -1,7 +1,9 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); +const { Agent } = require('https'); const { list } = require('../../util/Util'); const fonts = require('../../assets/json/cool-text'); +const noRejectAgent = new Agent({ rejectUnauthorized: false }); module.exports = class CoolTextCommand extends Command { constructor(client) { @@ -43,9 +45,7 @@ module.exports = class CoolTextCommand extends Command { ...fonts[font], Text: text }); - process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; - const { body: imageBody } = await request.get(body.renderLocation); - process.env.NODE_TLS_REJECT_UNAUTHORIZED = undefined; + 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}` }] }); } catch (err) {