fix: Cannot destructure property 'url' of '(intermediate value)' as it is undefined.

This commit is contained in:
Elysia 2023-04-24 22:07:28 +07:00
parent 00418e59be
commit 3397d8da71

View File

@ -140,13 +140,14 @@ class WebSocketManager extends EventEmitter {
*/ */
let gatewayURL = 'wss://gateway.discord.gg'; let gatewayURL = 'wss://gateway.discord.gg';
const { url } = await this.client.api.gateway const { url } = await this.client.api.gateway.get({ auth: false }).catch(() => ({ url: gatewayURL }));
.get({ auth: false })
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
/*
.catch(error => { .catch(error => {
// Never throw error :v // Never throw error :v
// throw error.httpStatus === 401 ? invalidToken : error; // throw error.httpStatus === 401 ? invalidToken : error;
}); });
*/
if (url) gatewayURL = url; if (url) gatewayURL = url;
const recommendedShards = 1; const recommendedShards = 1;
const sessionStartLimit = { const sessionStartLimit = {