diff --git a/src/Client.js b/src/Client.js index 385d17db..c1cc82ba 100644 --- a/src/Client.js +++ b/src/Client.js @@ -334,6 +334,16 @@ class Client extends EventsEmitter { return this.#guilds; } + /** + * The session data for this client. + * @type {Object} + * @readonly + * @public + */ + get sessionData() { + return this.#shards.map((shard) => shard.getSessionData()); + } + /** * The function to call when a soft restart is needed. * @public diff --git a/src/gateway/index.js b/src/gateway/index.js index afd8c797..239beffd 100644 --- a/src/gateway/index.js +++ b/src/gateway/index.js @@ -208,6 +208,14 @@ class Shard { this.#ws.send(_updatePresence(name, type, status, afk, since)); } + getSessionData() { + return { + sessionId: this.#_sessionId, + sequence: this.#_s, + resumeGatewayUrl: this.#resumeGatewayUrl, + }; + } + #heartbeatInit() { setTimeout(() => { this.#heartbeat();