Skip to content

Commit

Permalink
Merge branch 'main' into types/server-only-app-permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite authored May 31, 2023
2 parents ba78775 + df8b6e9 commit 84fd3e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ws/src/ws/WebSocketManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ export class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap> {

const data = (await this.options.rest.get(Routes.gatewayBot())) as RESTGetAPIGatewayBotResult;

this.gatewayInformation = { data, expiresAt: Date.now() + data.session_start_limit.reset_after };
// For single sharded bots session_start_limit.reset_after will be 0, use 5 seconds as a minimum expiration time
this.gatewayInformation = { data, expiresAt: Date.now() + (data.session_start_limit.reset_after || 5_000) };
return this.gatewayInformation.data;
}

Expand Down

0 comments on commit 84fd3e9

Please sign in to comment.