Skip to content

Commit

Permalink
fix: ok discord
Browse files Browse the repository at this point in the history
  • Loading branch information
MARCROCK22 committed Dec 11, 2024
1 parent 0a41934 commit 41c8f11
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/websocket/discord/shard.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { inflateSync } from 'node:zlib';
import { LogLevels, Logger, type MakeRequired, MergeOptions } from '../../common';
import { LogLevels, Logger, type MakeRequired, MergeOptions, hasIntent } from '../../common';
import {
GatewayCloseCodes,
GatewayDispatchEvents,
Expand Down Expand Up @@ -263,15 +263,16 @@ export class Shard {
}
break;
case GatewayDispatchEvents.Ready: {
for (let i = 0; i < packet.d.guilds.length; i++) {
this.pendingGuilds.add(packet.d.guilds.at(i)!.id);
if (hasIntent(this.options.intents, 'Guilds')) {
for (let i = 0; i < packet.d.guilds.length; i++) {
this.pendingGuilds.add(packet.d.guilds.at(i)!.id);
}
}

this.data.resume_gateway_url = packet.d.resume_gateway_url;
this.data.session_id = packet.d.session_id;
this.offlineSendQueue.map(resolve => resolve());
this.options.handlePayload(this.id, packet);

if (this.pendingGuilds.size === 0) {
this.isReady = true;
this.options.handlePayload(this.id, {
Expand Down

0 comments on commit 41c8f11

Please sign in to comment.