diff --git a/src/client/websocket/WebSocketManager.js b/src/client/websocket/WebSocketManager.js index 3de4b46..e7a5295 100644 --- a/src/client/websocket/WebSocketManager.js +++ b/src/client/websocket/WebSocketManager.js @@ -127,6 +127,8 @@ class WebSocketManager extends EventEmitter { */ async connect() { const invalidToken = new Error(WSCodes[4004]); + /* + BOT const { url: gatewayURL, shards: recommendedShards, @@ -134,6 +136,17 @@ class WebSocketManager extends EventEmitter { } = await this.client.api.gateway.bot.get().catch(error => { throw error.httpStatus === 401 ? invalidToken : error; }); + */ + + const { url: gatewayURL } = await this.client.api.gateway.get({ auth: false }).catch(error => { + // Never throw error :v + throw error.httpStatus === 401 ? invalidToken : error; + }); + const recommendedShards = 1; + const sessionStartLimit = { + total: 1000000000, + remaining: 1000000000, + }; const { total, remaining } = sessionStartLimit; diff --git a/src/util/Constants.js b/src/util/Constants.js index 07cb57b..6a2907f 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -175,6 +175,7 @@ exports.Endpoints = { invite: (root, code, eventId) => (eventId ? `${root}/${code}?event=${eventId}` : `${root}/${code}`), scheduledEvent: (root, guildId, eventId) => `${root}/${guildId}/${eventId}`, botGateway: '/gateway/bot', + userGateway: '/gateway', }; /** diff --git a/typings/index.d.ts b/typings/index.d.ts index 6859ec2..409f75d 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -3066,6 +3066,7 @@ export const Constants: { }; Endpoints: { botGateway: string; + userGateway: string; invite: (root: string, code: string, eventId?: Snowflake) => string; scheduledEvent: (root: string, guildId: Snowflake, eventId: Snowflake) => string; CDN: (root: string) => {