From cef3a568d24ae0b09986b92ea58f05d1ffcc9f32 Mon Sep 17 00:00:00 2001 From: Mabi19 Date: Tue, 12 Sep 2023 21:19:32 +0200 Subject: [PATCH 1/2] Fix voice state update sometimes not setting the member cache --- src/gateway/handlers/voiceStateUpdate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gateway/handlers/voiceStateUpdate.ts b/src/gateway/handlers/voiceStateUpdate.ts index 520aa635..5b465e4d 100644 --- a/src/gateway/handlers/voiceStateUpdate.ts +++ b/src/gateway/handlers/voiceStateUpdate.ts @@ -14,10 +14,11 @@ export const voiceStateUpdate: GatewayEventHandler = async ( )) as unknown as Guild const voiceState = await guild.voiceStates.get(d.user_id) + + await guild.members.set(d.user_id, d.member as unknown as MemberPayload) if (d.channel_id === null) { if (voiceState === undefined) { - await guild.members.set(d.user_id, d.member as unknown as MemberPayload) const member = (await guild.members.get( d.user_id )) as unknown as MemberPayload From 91517bcca6f1dbfef324cae403414d40a6cffbe9 Mon Sep 17 00:00:00 2001 From: Mabi19 Date: Wed, 20 Sep 2023 16:23:59 +0200 Subject: [PATCH 2/2] Remove rogue whitespace I forgot to enable the whitespace trimming option on my new PC :( --- src/gateway/handlers/voiceStateUpdate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gateway/handlers/voiceStateUpdate.ts b/src/gateway/handlers/voiceStateUpdate.ts index 5b465e4d..c9f8d299 100644 --- a/src/gateway/handlers/voiceStateUpdate.ts +++ b/src/gateway/handlers/voiceStateUpdate.ts @@ -14,7 +14,7 @@ export const voiceStateUpdate: GatewayEventHandler = async ( )) as unknown as Guild const voiceState = await guild.voiceStates.get(d.user_id) - + await guild.members.set(d.user_id, d.member as unknown as MemberPayload) if (d.channel_id === null) {