mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 06:20:24 +00:00
fix: do not set state deleted if api is unreachable
This commit is contained in:
parent
84b0863d0e
commit
98aa7646b6
@ -76,7 +76,10 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {
|
|||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
const discordBot = await get.discord.user.load(res.id)
|
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')
|
knex('bots')
|
||||||
.update({ state: 'deleted' })
|
.update({ state: 'deleted' })
|
||||||
.where({ id })
|
.where({ id })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user