mirror of
https://github.com/koreanbots/core.git
synced 2025-12-17 06:40:24 +00:00
fix: check bot strikes properly (#536)
This commit is contained in:
parent
3f5046b6c1
commit
ea3060c85f
@ -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}%`)
|
const submits = await knex('submitted').select(['id']).where({ state: 0 }).andWhere('owners', 'LIKE', `%${id}%`)
|
||||||
if(submits.length > 1) return 1
|
if(submits.length > 1) return 1
|
||||||
const botId = data.id
|
const botId = data.id
|
||||||
const strikes = await get.botSubmitStrikes(id)
|
const strikes = await get.botSubmitStrikes(botId)
|
||||||
if(strikes >= 3) return 5
|
if(strikes >= 3) return 5
|
||||||
const date = Math.round(+new Date()/1000)
|
const date = Math.round(+new Date()/1000)
|
||||||
const sameID = await knex('submitted').select(['id']).where({ id: botId, state: 0 })
|
const sameID = await knex('submitted').select(['id']).where({ id: botId, state: 0 })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user