fix: check bot strikes properly (#536)

This commit is contained in:
SKINMAKER 2023-02-01 19:32:24 +08:00 committed by GitHub
parent 3f5046b6c1
commit ea3060c85f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 })