fix: do not set state deleted if api is unreachable

This commit is contained in:
skinmaker1345 2025-01-29 23:22:28 +07:00
parent 84b0863d0e
commit 98aa7646b6

View File

@ -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 })