Skip to content

Commit

Permalink
fix: do not set state deleted if api is unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
skinmaker1345 committed Jan 29, 2025
1 parent 84b0863 commit 98aa764
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {

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 })
Expand Down

0 comments on commit 98aa764

Please sign in to comment.