Compare commits

..

No commits in common. "32369b0e9139aabbf7b0fbea840afa79b3d42205" and "683f7f8b7ba3a691f2bd1b896d595a38babd5414" have entirely different histories.

View File

@ -68,7 +68,6 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {
'bots.vanity',
'bots.bg',
'bots.banner',
'bots.updated_at',
knex.raw('JSON_ARRAYAGG(owners_mapping.user_id) as owners'),
])
.leftJoin('owners_mapping', 'bots.id', 'owners_mapping.target_id')
@ -89,12 +88,12 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {
.then((r) => r)
}
const botMember =
(await getMainGuild()
((await getMainGuild()
?.members?.fetch(res.id)
.catch((e) => null)) ??
((await getBotGuild()
?.members?.fetch(res.id)
.catch((e) => null)) as GuildMember)
.catch((e) => null))) as GuildMember)
const name = discordBot.displayName
res.flags =
res.flags |
@ -120,9 +119,7 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {
: botMember.presence.status
}
} else {
const updatedAt = new Date(res.updated_at).getTime()
const diff = +new Date() - updatedAt
res.status = diff > 1000 * 60 * 60 * 48 ? 'offline' : 'online'
res.status = null
}
delete res.trusted
delete res.partnered
@ -796,7 +793,6 @@ async function updateServer(id: string, servers: number, shards: number) {
.update({
servers: servers === undefined ? bot.servers : servers,
shards: shards === undefined ? bot.shards : shards,
updated_at: knex.fn.now(),
})
.where({ id })
if (servers) {
@ -1179,7 +1175,6 @@ async function approveBotSubmission(id: string, date: number) {
enforcements: data.enforcements,
discord: data.discord,
token: sign({ id }),
updated_at: knex.fn.now(),
})
updateOwners(id, [data.owner], 'bot')
return true