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

index f63e4a15..5237e766 100644 --- a/src/gateway/opcodes/StreamWatch.ts +++ b/src/gateway/opcodes/StreamWatch.ts
@@ -40,7 +40,7 @@ export async function onStreamWatch(this: WebSocket, data: Payload) { try { parsedKey = parseStreamKey(body.stream_key); } catch (e) { - return this.close(4000, "Invalid stream key"); + return this.rawSocket.close(4000, "Invalid stream key"); } const { type, channelId, guildId, userId } = parsedKey; @@ -50,14 +50,14 @@ export async function onStreamWatch(this: WebSocket, data: Payload) { relations: { channel: true }, }); - if (!stream) return this.close(4000, "Invalid stream key"); + if (!stream) return this.rawSocket.close(4000, "Invalid stream key"); - if (type === "guild" && stream.channel.guild_id != guildId) return this.close(4000, "Invalid stream key"); + if (type === "guild" && stream.channel.guild_id != guildId) return this.rawSocket.close(4000, "Invalid stream key"); const regions = Config.get().regions; const guildRegion = regions.available.find((r) => r.endpoint === stream.endpoint); - if (!guildRegion) return this.close(4000, "Unknown region"); + if (!guildRegion) return this.rawSocket.close(4000, "Unknown region"); const streamSession = StreamSession.create({ stream_id: stream.id,