mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 22:30:23 +00:00
fix: handle invalid user
This commit is contained in:
parent
38f97d054a
commit
d9c0bf232c
@ -48,7 +48,8 @@ async function getBot(id: string, owners=true) {
|
|||||||
.orWhere({ vanity: id, trusted: true })
|
.orWhere({ vanity: id, trusted: true })
|
||||||
.orWhere({ vanity: id, partnered: true })
|
.orWhere({ vanity: id, partnered: true })
|
||||||
if (res[0]) {
|
if (res[0]) {
|
||||||
const discordBot = await get.discord.user.load(id)
|
const discordBot = await get.discord.user.load(res[0].id)
|
||||||
|
if(!discordBot) return null
|
||||||
res[0].tag = discordBot.discriminator
|
res[0].tag = discordBot.discriminator
|
||||||
res[0].name = discordBot.username
|
res[0].name = discordBot.username
|
||||||
res[0].category = JSON.parse(res[0].category)
|
res[0].category = JSON.parse(res[0].category)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user