From cba3844c6f7a6b26c93d8061da0ca7fe6b291e92 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 6 Aug 2022 18:25:30 +0200 Subject: Resolve changes undone by rebasing from master --- gateway/src/opcodes/Identify.ts | 4 ++-- gateway/src/opcodes/LazyRequest.ts | 2 +- gateway/src/opcodes/VoiceStateUpdate.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'gateway/src/opcodes') diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts index bfe748f1..13d55559 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts @@ -58,7 +58,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { relations: ["relationships", "relationships.to"], select: [...PrivateUserProjection, "relationships"], }), - ReadState.find({ user_id: this.user_id }), + ReadState.find({ where: { user_id: this.user_id } }), Member.find({ where: { id: this.user_id }, select: MemberPrivateProjection, @@ -96,7 +96,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { }, activities: [], }).save(), - Application.findOne({ id: this.user_id }), + Application.findOne({ where: { id: this.user_id } }), ]); if (!user) return this.close(CLOSECODES.Authentication_failed); diff --git a/gateway/src/opcodes/LazyRequest.ts b/gateway/src/opcodes/LazyRequest.ts index dd96d6d7..974769e9 100644 --- a/gateway/src/opcodes/LazyRequest.ts +++ b/gateway/src/opcodes/LazyRequest.ts @@ -120,7 +120,7 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { const ranges = channels![channel_id]; if (!Array.isArray(ranges)) throw new Error("Not a valid Array"); - const member_count = await Member.count({ guild_id }); + const member_count = await Member.count({ where: { guild_id } }); const ops = await Promise.all(ranges.map((x) => getMembers(guild_id, x))); // TODO: unsubscribe member_events that are not in op.members diff --git a/gateway/src/opcodes/VoiceStateUpdate.ts b/gateway/src/opcodes/VoiceStateUpdate.ts index 321e6b17..7f7db9b0 100644 --- a/gateway/src/opcodes/VoiceStateUpdate.ts +++ b/gateway/src/opcodes/VoiceStateUpdate.ts @@ -84,7 +84,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) { -- cgit 1.5.1