Skip to content

Commit

Permalink
Merge pull request #368 from Mabi19/main
Browse files Browse the repository at this point in the history
Fix voice state update sometimes not setting the member cache
  • Loading branch information
Helloyunho authored Sep 25, 2023
2 parents 314c066 + 91517bc commit 80b3317
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gateway/handlers/voiceStateUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export const voiceStateUpdate: GatewayEventHandler = async (

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
Expand Down

0 comments on commit 80b3317

Please sign in to comment.