Fixed Proxy

This commit is contained in:
GamerboyTR
2023-12-23 03:38:08 +03:00
parent 14564a6e02
commit 9106bd970a
4 changed files with 54 additions and 9 deletions
+3 -4
View File
@@ -40,7 +40,7 @@ const Options = require('../util/Options');
const Permissions = require('../util/Permissions');
const DiscordAuthWebsocket = require('../util/RemoteAuth');
const Sweepers = require('../util/Sweepers');
const { testImportModule } = require('../util/Util');
const { getProxyObject } = require('../util/Util');
/**
* The main hub for interacting with the Discord API, and the starting point for any bot.
@@ -1021,10 +1021,9 @@ class Client extends BaseClient {
} else if (
options &&
options.proxy &&
typeof options.proxy === 'string' &&
testImportModule('proxy-agent') === false
typeof options.proxy === 'string'
) {
throw new Error('MISSING_MODULE', 'proxy-agent', 'npm install proxy-agent@5');
getProxyObject(options.proxy);
}
if (typeof options.shardCount !== 'number' || isNaN(options.shardCount) || options.shardCount < 1) {
throw new TypeError('CLIENT_INVALID_OPTION', 'shardCount', 'a number greater than or equal to 1');