summary refs log tree commit diff
path: root/gateway/src/opcodes
diff options
context:
space:
mode:
Diffstat (limited to 'gateway/src/opcodes')
-rw-r--r--gateway/src/opcodes/Identify.ts2
-rw-r--r--gateway/src/opcodes/VoiceStateUpdate.ts5
2 files changed, 6 insertions, 1 deletions
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts

index 860000da..301f714d 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts
@@ -35,6 +35,8 @@ import { Recipient } from "@fosscord/util"; export async function onIdentify(this: WebSocket, data: Payload) { clearTimeout(this.readyTimeout); + if (typeof data.d?.client_state?.highest_last_message_id === "number") + data.d.client_state.highest_last_message_id += ""; check.call(this, IdentifySchema, data.d); const identify: IdentifySchema = data.d; 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();