Skip to content

Commit 98aa764

Browse files
committed
fix: do not set state deleted if api is unreachable
1 parent 84b0863 commit 98aa764

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utils/Query.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {
7676

7777
if (res) {
7878
const discordBot = await get.discord.user.load(res.id)
79-
if (!discordBot || Number(discordBot.discriminator) === 0) {
79+
if(!discordBot) {
80+
return null
81+
}
82+
if (Number(discordBot.discriminator) === 0) {
8083
knex('bots')
8184
.update({ state: 'deleted' })
8285
.where({ id })

0 commit comments

Comments
 (0)