discord.js 15.0.0-dev.1764331308-444e55a09 → 15.0.0-dev.1764374516-19253f6b7

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "discord.js",
4
- "version": "15.0.0-dev.1764331308-444e55a09",
4
+ "version": "15.0.0-dev.1764374516-19253f6b7",
5
5
  "description": "A powerful library for interacting with the Discord API",
6
6
  "main": "./src/index.js",
7
7
  "types": "./typings/index.d.ts",
@@ -61,12 +61,12 @@
61
61
  "magic-bytes.js": "^1.12.1",
62
62
  "tslib": "^2.8.1",
63
63
  "undici": "7.16.0",
64
- "@discordjs/builders": "2.0.0-dev.1764331308-444e55a09",
65
- "@discordjs/formatters": "1.0.0-dev.1764331308-444e55a09",
66
- "@discordjs/rest": "3.0.0-dev.1764331308-444e55a09",
67
- "@discordjs/util": "2.0.0-dev.1764331308-444e55a09",
68
- "@discordjs/collection": "3.0.0-dev.1764331308-444e55a09",
69
- "@discordjs/ws": "3.0.0-dev.1764331308-444e55a09"
64
+ "@discordjs/builders": "2.0.0-dev.1764374516-19253f6b7",
65
+ "@discordjs/collection": "3.0.0-dev.1764374516-19253f6b7",
66
+ "@discordjs/formatters": "1.0.0-dev.1764374516-19253f6b7",
67
+ "@discordjs/util": "2.0.0-dev.1764374516-19253f6b7",
68
+ "@discordjs/rest": "3.0.0-dev.1764374516-19253f6b7",
69
+ "@discordjs/ws": "3.0.0-dev.1764374516-19253f6b7"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@favware/cliff-jumper": "^4.1.0",
@@ -389,15 +389,6 @@ class Client extends AsyncEventEmitter {
389
389
  );
390
390
  this.ws.on(WebSocketShardEvents.Dispatch, this._handlePacket.bind(this));
391
391
 
392
- this.ws.on(WebSocketShardEvents.Ready, async data => {
393
- for (const guild of data.guilds) {
394
- this.expectedGuilds.add(guild.id);
395
- }
396
-
397
- this.status = Status.WaitingForGuilds;
398
- await this._checkReady();
399
- });
400
-
401
392
  this.ws.on(WebSocketShardEvents.HeartbeatComplete, ({ heartbeatAt, latency }, shardId) => {
402
393
  this.emit(Events.Debug, `[WS => Shard ${shardId}] Heartbeat acknowledged, latency of ${latency}ms.`);
403
394
  this.lastPingTimestamps.set(shardId, heartbeatAt);
@@ -427,7 +418,9 @@ class Client extends AsyncEventEmitter {
427
418
  PacketHandlers[packet.t](this, packet, shardId);
428
419
  }
429
420
 
430
- if (this.status === Status.WaitingForGuilds && WaitingForGuildEvents.includes(packet.t)) {
421
+ if (packet.t === GatewayDispatchEvents.Ready) {
422
+ await this._checkReady();
423
+ } else if (this.status === Status.WaitingForGuilds && WaitingForGuildEvents.includes(packet.t)) {
431
424
  this.expectedGuilds.delete(packet.d.id);
432
425
  await this._checkReady();
433
426
  }
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const { ClientApplication } = require('../../../structures/ClientApplication.js');
4
+ const { Status } = require('../../../util/Status.js');
4
5
 
5
6
  let ClientUser;
6
7
 
@@ -14,6 +15,7 @@ module.exports = (client, { d: data }, shardId) => {
14
15
  }
15
16
 
16
17
  for (const guild of data.guilds) {
18
+ client.expectedGuilds.add(guild.id);
17
19
  guild.shardId = shardId;
18
20
  client.guilds._add(guild);
19
21
  }
@@ -23,4 +25,6 @@ module.exports = (client, { d: data }, shardId) => {
23
25
  } else {
24
26
  client.application = new ClientApplication(client, data.application);
25
27
  }
28
+
29
+ client.status = Status.WaitingForGuilds;
26
30
  };