diff --git a/utils/Query.ts b/utils/Query.ts index eda62b3..83b3bf2 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -76,7 +76,10 @@ async function getBot(id: string, topLevel = true): Promise { if (res) { const discordBot = await get.discord.user.load(res.id) - if (!discordBot || Number(discordBot.discriminator) === 0) { + if(!discordBot) { + return null + } + if (Number(discordBot.discriminator) === 0) { knex('bots') .update({ state: 'deleted' }) .where({ id })