fix missing properties in GUILD_CREATE for bots

This commit is contained in:
dank074 2025-04-09 15:39:17 -05:00
parent 126a881f31
commit 64d5dcd53f

View File

@ -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 // 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( await Promise.all(
pending_guilds.map((x) => pending_guilds.map((x) =>
Send(this, { Send(this, {
op: OPCODES.Dispatch, op: OPCODES.Dispatch,
t: EVENTEnum.GuildCreate, t: EVENTEnum.GuildCreate,
s: this.sequence++, s: this.sequence++,
d: x, d: {
...new ReadyGuildDTO(x).toJSON(),
},
})?.catch((e) => })?.catch((e) =>
console.error(`[Gateway] error when sending bot guilds`, e), console.error(`[Gateway] error when sending bot guilds`, e),
), ),