From 12f96a579a50d8c87c99de8fcdb496ce59d1b409 Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Sun, 3 Sep 2023 19:25:51 +0700 Subject: [PATCH] fix: proxy is not a constructor (2) #833 #656 --- src/rest/APIRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rest/APIRequest.js b/src/rest/APIRequest.js index 6ecf577..fe3b166 100644 --- a/src/rest/APIRequest.js +++ b/src/rest/APIRequest.js @@ -36,7 +36,7 @@ class APIRequest { if (agent === null) { if (typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0) { const proxy = require('proxy-agent'); - agent = new proxy(this.client.options.proxy); + agent = new proxy.ProxyAgent(this.client.options.proxy); } else if (this.client.options.http.agent instanceof https.Agent) { agent = this.client.options.http.agent; agent.keepAlive = true;