summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-10-17 09:54:15 +0200
committerRory& <root@rory.gay>2026-10-17 09:54:15 +0200
commit91bfce71eefba5e44f3d97b21490fe60c572a12e (patch)
tree00008c365ce9848fcabe062338b33df3dfded164
parentDont exclude LazyRequestSchema, oops (diff)
downloadserver-ts-91bfce71eefba5e44f3d97b21490fe60c572a12e.tar.xz
VoiceStateUpdate: coalesce empty channel/guild ids to undefined
-rw-r--r--src/gateway/opcodes/VoiceStateUpdate.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gateway/opcodes/VoiceStateUpdate.ts b/src/gateway/opcodes/VoiceStateUpdate.ts

index 49f4be8c6..a7d42cd11 100644 --- a/src/gateway/opcodes/VoiceStateUpdate.ts +++ b/src/gateway/opcodes/VoiceStateUpdate.ts
@@ -45,6 +45,10 @@ export async function onVoiceStateUpdate(this: WebSocket, data: Payload) { } const body = data.d as VoiceStateUpdateSchema; + // TODO: should this be null? + if (body.channel_id == "") body.channel_id = undefined; + if (body.guild_id == "") body.guild_id = undefined; + const isNew = body.channel_id === null && body.guild_id === null; let isChanged = false;