seyfert 3.1.3-dev-15087248840.0 → 3.1.3-dev-15150551625.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,7 +23,7 @@ export declare class Shard {
|
|
|
23
23
|
heart: ShardHeart;
|
|
24
24
|
bucket: DynamicBucket;
|
|
25
25
|
offlineSendQueue: ((_?: unknown) => void)[];
|
|
26
|
-
pendingGuilds
|
|
26
|
+
pendingGuilds?: Set<string>;
|
|
27
27
|
options: MakeRequired<ShardOptions, 'properties' | 'ratelimitOptions' | 'reconnectTimeout' | 'connectionTimeout'>;
|
|
28
28
|
isReady: boolean;
|
|
29
29
|
connectionTimeout?: NodeJS.Timeout;
|
|
@@ -24,7 +24,7 @@ class Shard {
|
|
|
24
24
|
};
|
|
25
25
|
bucket;
|
|
26
26
|
offlineSendQueue = [];
|
|
27
|
-
pendingGuilds
|
|
27
|
+
pendingGuilds;
|
|
28
28
|
options;
|
|
29
29
|
isReady = false;
|
|
30
30
|
connectionTimeout;
|
|
@@ -217,15 +217,13 @@ class Shard {
|
|
|
217
217
|
clearTimeout(this.connectionTimeout);
|
|
218
218
|
this.connectionTimeout = undefined;
|
|
219
219
|
if ((0, common_1.hasIntent)(this.options.intents, 'Guilds')) {
|
|
220
|
-
|
|
221
|
-
this.pendingGuilds.add(packet.d.guilds.at(i).id);
|
|
222
|
-
}
|
|
220
|
+
this.pendingGuilds = new Set(packet.d.guilds.map(guild => guild.id));
|
|
223
221
|
}
|
|
224
222
|
this.data.resume_gateway_url = packet.d.resume_gateway_url;
|
|
225
223
|
this.data.session_id = packet.d.session_id;
|
|
226
224
|
this.offlineSendQueue.map(resolve => resolve());
|
|
227
225
|
this.options.handlePayload(this.id, packet);
|
|
228
|
-
if (this.pendingGuilds
|
|
226
|
+
if (this.pendingGuilds?.size === 0) {
|
|
229
227
|
this.isReady = true;
|
|
230
228
|
this.options.handlePayload(this.id, {
|
|
231
229
|
t: types_1.GatewayDispatchEvents.GuildsReady,
|
|
@@ -237,7 +235,7 @@ class Shard {
|
|
|
237
235
|
}
|
|
238
236
|
case types_1.GatewayDispatchEvents.GuildCreate:
|
|
239
237
|
case types_1.GatewayDispatchEvents.GuildDelete:
|
|
240
|
-
if (this.pendingGuilds
|
|
238
|
+
if (this.pendingGuilds?.delete(packet.d.id)) {
|
|
241
239
|
packet.t = `RAW_${packet.t}`;
|
|
242
240
|
this.options.handlePayload(this.id, packet);
|
|
243
241
|
if (this.pendingGuilds.size === 0) {
|