Skip to content

Commit

Permalink
Fix voice state update sometimes not setting the member cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Mabi19 committed Sep 12, 2023
1 parent 314c066 commit cef3a56
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 @@ -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
Expand Down

0 comments on commit cef3a56

Please sign in to comment.