From 1238fe0c812acc36485ccfdd6b1e57e157a7c81a Mon Sep 17 00:00:00 2001 From: skinmaker1345 Date: Sat, 19 Oct 2024 23:29:57 +0900 Subject: [PATCH] fix: query by vanity does not work --- utils/Query.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/Query.ts b/utils/Query.ts index dcc0da83b4..819b075035 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -70,8 +70,8 @@ async function getBot(id: string, topLevel = true): Promise { ]) .leftJoin('owners_mapping', 'bots.id', 'owners_mapping.target_id') .where({ 'bots.id': id }) - .orWhereRaw(`(bots.flags & ${BotFlags.trusted}) and bots.vanity=?`, [id]) - .orWhereRaw(`(bots.flags & ${BotFlags.partnered}) and bots.vanity=?`, [id]) + .orWhere({ vanity: id, trusted: true }) + .orWhere({ vanity: id, partnered: true }) .groupBy('bots.id')) as any[] if (res) {