From 2d044dceb43222a842dc2cad7b4fc1f44130285f Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Fri, 17 Jun 2022 13:34:42 +0700 Subject: [PATCH] Support Bots (maybe) --- src/client/websocket/WebSocketShard.js | 2 +- src/util/Options.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/websocket/WebSocketShard.js b/src/client/websocket/WebSocketShard.js index 8ad3626..01cfc9e 100644 --- a/src/client/websocket/WebSocketShard.js +++ b/src/client/websocket/WebSocketShard.js @@ -532,7 +532,7 @@ class WebSocketShard extends EventEmitter { this.emit(ShardEvents.ALL_READY, this.expectedGuilds); }, - hasGuildsIntent ? waitGuildTimeout : 0, + hasGuildsIntent && this.manager.client.user.bot ? waitGuildTimeout : 0, ).unref(); } diff --git a/src/util/Options.js b/src/util/Options.js index 19f64fe..658fad9 100644 --- a/src/util/Options.js +++ b/src/util/Options.js @@ -79,7 +79,7 @@ const JSONBig = require('json-bigint'); * [User Agent](https://discord.com/developers/docs/reference#user-agent) header * @property {PresenceData} [presence={}] Presence data to use upon login * @property {IntentsResolvable} [intents=131071] Intents to enable for this connection (but not using) - * @property {number} [waitGuildTimeout=0] Time in milliseconds that Clients with the GUILDS intent should wait for + * @property {number} [waitGuildTimeout=15000] Time in milliseconds that Clients with the GUILDS intent should wait for * missing guilds to be received before starting the bot. If not specified, the default is 15 seconds. * @property {SweeperOptions} [sweepers={}] Options for cache sweeping * @property {WebsocketOptions} [ws] Options for the WebSocket @@ -145,7 +145,7 @@ class Options extends null { readyStatus: true, autoCookie: true, patchVoice: true, - waitGuildTimeout: 0, + waitGuildTimeout: 15_000, shardCount: 1, makeCache: this.cacheWithLimits(this.defaultMakeCacheSettings), messageCacheLifetime: 0,