Fixed Proxy
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user