From ea3060c85f1b45ba99924f8e8e6ebeffc3affe8c Mon Sep 17 00:00:00 2001 From: SKINMAKER Date: Wed, 1 Feb 2023 19:32:24 +0800 Subject: [PATCH] fix: check bot strikes properly (#536) --- utils/Query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/Query.ts b/utils/Query.ts index c709b45..7198c34 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -407,7 +407,7 @@ async function submitBot(id: string, data: AddBotSubmit):Promise<1|2|3|4|5|Submi const submits = await knex('submitted').select(['id']).where({ state: 0 }).andWhere('owners', 'LIKE', `%${id}%`) if(submits.length > 1) return 1 const botId = data.id - const strikes = await get.botSubmitStrikes(id) + const strikes = await get.botSubmitStrikes(botId) if(strikes >= 3) return 5 const date = Math.round(+new Date()/1000) const sameID = await knex('submitted').select(['id']).where({ id: botId, state: 0 })