mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: added bot remove method
This commit is contained in:
parent
8ae8aebd01
commit
a15c3fba71
@ -225,6 +225,12 @@ async function getBotSpec(id: string, userID: string) {
|
||||
return serialize(res[0])
|
||||
}
|
||||
|
||||
async function deleteBot(id: string): Promise<boolean> {
|
||||
const bot = await knex('bots').where({ id }).del()
|
||||
|
||||
return !!bot
|
||||
}
|
||||
|
||||
async function updateBot(id: string, data: ManageBot) {
|
||||
const res = await knex('bots').where({ id })
|
||||
if(res.length === 0 || res[0].state !== 'ok') return 0
|
||||
@ -436,6 +442,10 @@ export const put = {
|
||||
submitBot
|
||||
}
|
||||
|
||||
export const remove = {
|
||||
bot: deleteBot
|
||||
}
|
||||
|
||||
export const ratelimit = {
|
||||
image: (ip: string) => {
|
||||
addRequest(ip, imageRateLimit)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user