mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(WebSocketShard): wait for hello rather than ready in connect (#9178)
This commit is contained in:
@@ -5,7 +5,7 @@ import type { SessionInfo, WebSocketManager, WebSocketManagerOptions } from '../
|
||||
export interface FetchingStrategyOptions
|
||||
extends Omit<
|
||||
WebSocketManagerOptions,
|
||||
'rest' | 'retrieveSessionInfo' | 'shardCount' | 'shardIds' | 'updateSessionInfo'
|
||||
'buildStrategy' | 'rest' | 'retrieveSessionInfo' | 'shardCount' | 'shardIds' | 'updateSessionInfo'
|
||||
> {
|
||||
readonly gatewayInformation: APIGatewayBotInfo;
|
||||
readonly shardCount: number;
|
||||
@@ -23,7 +23,8 @@ export interface IContextFetchingStrategy {
|
||||
|
||||
export async function managerToFetchingStrategyOptions(manager: WebSocketManager): Promise<FetchingStrategyOptions> {
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
const { retrieveSessionInfo, updateSessionInfo, shardCount, shardIds, rest, ...managerOptions } = manager.options;
|
||||
const { buildStrategy, retrieveSessionInfo, updateSessionInfo, shardCount, shardIds, rest, ...managerOptions } =
|
||||
manager.options;
|
||||
|
||||
return {
|
||||
...managerOptions,
|
||||
|
||||
@@ -164,7 +164,7 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
|
||||
this.sendRateLimitState = getInitialSendRateLimitState();
|
||||
|
||||
const { ok } = await this.bubbleWaitForEventError(
|
||||
this.waitForEvent(WebSocketShardEvents.Ready, this.strategy.options.readyTimeout),
|
||||
this.waitForEvent(WebSocketShardEvents.Hello, this.strategy.options.helloTimeout),
|
||||
);
|
||||
if (!ok) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user