From 64d5dcd53feccc25f176ed3fab45ad0de50b6367 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 9 Apr 2025 15:39:17 -0500 Subject: [PATCH] fix missing properties in GUILD_CREATE for bots --- src/gateway/opcodes/Identify.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index c6f987fc..155dcb5a 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -455,13 +455,16 @@ export async function onIdentify(this: WebSocket, data: Payload) { }); // If we're a bot user, send GUILD_CREATE for each unavailable guild + // TODO: check if bot has permission to view some of these based on intents (i.e. GUILD_MEMBERS, GUILD_PRESENCES, GUILD_VOICE_STATES) await Promise.all( pending_guilds.map((x) => Send(this, { op: OPCODES.Dispatch, t: EVENTEnum.GuildCreate, s: this.sequence++, - d: x, + d: { + ...new ReadyGuildDTO(x).toJSON(), + }, })?.catch((e) => console.error(`[Gateway] error when sending bot guilds`, e), ),