From d9c0bf232c29512c5d2b6024a17bb178a9465ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Mon, 25 Jan 2021 19:54:49 +0900 Subject: [PATCH] fix: handle invalid user --- utils/Query.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/Query.ts b/utils/Query.ts index 446fdaf..ba695e3 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -48,7 +48,8 @@ async function getBot(id: string, owners=true) { .orWhere({ vanity: id, trusted: true }) .orWhere({ vanity: id, partnered: true }) if (res[0]) { - const discordBot = await get.discord.user.load(id) + const discordBot = await get.discord.user.load(res[0].id) + if(!discordBot) return null res[0].tag = discordBot.discriminator res[0].name = discordBot.username res[0].category = JSON.parse(res[0].category)