diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-07-09 16:34:41 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-07-09 16:38:45 +1000 |
commit | 76d094a492635b39fd39c10dc12c3232c5998da9 (patch) | |
tree | e368f7f35eb85f7a73a5d57c1cee6d29286928ba | |
parent | Merge branch 'fix/messageLinkMetas' into slowcord (diff) | |
download | server-76d094a492635b39fd39c10dc12c3232c5998da9.tar.xz |
Test fix for that voice state error
-rw-r--r-- | gateway/src/opcodes/VoiceStateUpdate.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gateway/src/opcodes/VoiceStateUpdate.ts b/gateway/src/opcodes/VoiceStateUpdate.ts index 321e6b17..ec4b1a92 100644 --- a/gateway/src/opcodes/VoiceStateUpdate.ts +++ b/gateway/src/opcodes/VoiceStateUpdate.ts @@ -58,6 +58,9 @@ export async function onVoiceStateUpdate(this: WebSocket, data: Payload) { }); } + // 'Fix' for this one voice state error + if (!voiceState.guild_id) return; + //TODO the member should only have these properties: hoisted_role, deaf, joined_at, mute, roles, user //TODO the member.user should only have these properties: avatar, discriminator, id, username //TODO this may fail @@ -65,7 +68,7 @@ export async function onVoiceStateUpdate(this: WebSocket, data: Payload) { where: { id: voiceState.user_id, guild_id: voiceState.guild_id }, relations: ["user", "roles"], }); - + //If the session changed we generate a new token if (voiceState.session_id !== this.session_id) voiceState.token = genVoiceToken(); |