From 8f153a0d36ae2472bd76f1a48bbcffa930e4dac9 Mon Sep 17 00:00:00 2001 From: wonderlandpark Date: Sun, 28 Mar 2021 12:59:47 +0900 Subject: [PATCH] fix: https://github.com/koreanbots/v2-testing/issues/73 --- utils/Query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/Query.ts b/utils/Query.ts index ccedf2e..8577530 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -54,7 +54,6 @@ async function getBot(id: string, owners=true):Promise { res[0].category = JSON.parse(res[0].category) res[0].owners = JSON.parse(res[0].owners) res[0].status = discordBot.presence?.activities?.find(r => r.type === 'STREAMING') ? 'streaming' : discordBot.presence?.status || null - console.log(res[0].name, discordBot.presence?.status) delete res[0].trusted delete res[0].partnered if (owners) @@ -172,6 +171,7 @@ async function getBotSubmit(id: string, date: number) { } async function getBotSubmits(id: string) { + if(!id) return [] let res = await knex('submitted').select(['id', 'date', 'category', 'lib', 'prefix', 'intro', 'desc', 'url', 'web', 'git', 'discord', 'state', 'owners', 'reason']).orderBy('date', 'desc').where('owners', 'LIKE', `%${id}%`) res = await Promise.all(res.map(async el=> { el.category = JSON.parse(el.category)