This commit is contained in:
dalbodeule 2024-08-14 19:28:14 +09:00
parent 9ab004d646
commit 40f1df7ba6
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65
2 changed files with 7 additions and 5 deletions

View File

@ -131,9 +131,9 @@ val server = embeddedServer(Netty, port = 8080, ) {
}.map { it.id }
))
DiscordGuildCache.addGuild(guilds.associate {
it.id to CachedGuilds(
Guild(it.id, it.name, it.icon, it.banner)
)
println("${it.id} ${it.name}")
it.id to Guild(it.id, it.name, it.icon, it.banner)
})
redirects[principal.state]?.let { redirect ->

View File

@ -70,8 +70,10 @@ object DiscordGuildCache {
}
}
fun addGuild(guilds: Map<String, CachedGuilds>) {
cache.putAll(guilds)
fun addGuild(guilds: Map<String, Guild>) {
cache.putAll(guilds.map {
it.key to CachedGuilds(it.value, Instant.now())
})
}
}