summary refs log tree commit diff
path: root/src/gateway/opcodes/VoiceStateUpdate.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 18:24:21 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 23:35:18 +1000
commitf44f5d7ac2d24ff836c2e1d4b2fa58da04b13052 (patch)
treea6655c41bb3db79c30fd876b06ee60fe9cf70c9b /src/gateway/opcodes/VoiceStateUpdate.ts
parentAllow edited_timestamp to passthrough in handleMessage (diff)
downloadserver-f44f5d7ac2d24ff836c2e1d4b2fa58da04b13052.tar.xz
Refactor to mono-repo + upgrade packages
Diffstat (limited to '')
-rw-r--r--src/gateway/opcodes/VoiceStateUpdate.ts (renamed from gateway/src/opcodes/VoiceStateUpdate.ts)6
1 files changed, 3 insertions, 3 deletions
diff --git a/gateway/src/opcodes/VoiceStateUpdate.ts b/src/gateway/opcodes/VoiceStateUpdate.ts

index ec4b1a92..fa63f7fc 100644 --- a/gateway/src/opcodes/VoiceStateUpdate.ts +++ b/src/gateway/opcodes/VoiceStateUpdate.ts
@@ -49,7 +49,7 @@ export async function onVoiceStateUpdate(this: WebSocket, data: Payload) { if (body.guild_id === null) body.guild_id = voiceState.guild_id; voiceState.assign(body); } catch (error) { - voiceState = new VoiceState({ + voiceState = VoiceState.create({ ...body, user_id: this.user_id, deaf: false, @@ -68,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(); @@ -87,7 +87,7 @@ export async function onVoiceStateUpdate(this: WebSocket, data: Payload) { //If it's null it means that we are leaving the channel and this event is not needed if (voiceState.channel_id !== null) { - const guild = await Guild.findOne({ id: voiceState.guild_id }); + const guild = await Guild.findOne({ where: { id: voiceState.guild_id } }); const regions = Config.get().regions; let guildRegion: Region; if (guild && guild.region) {