diff --git a/utils/Query.ts b/utils/Query.ts index 1cd2631..e8d0a68 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -225,6 +225,12 @@ async function getBotSpec(id: string, userID: string) { return serialize(res[0]) } +async function deleteBot(id: string): Promise { + 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)