mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
debug discord login (11x)
- getUserGuilds fix (2x)
This commit is contained in:
parent
18ad1c8b83
commit
15b40bbc54
@ -21,7 +21,6 @@ import io.ktor.server.sessions.*
|
||||
import io.ktor.server.websocket.*
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.slf4j.LoggerFactory
|
||||
import space.mori.chzzk_bot.common.services.UserService
|
||||
import space.mori.chzzk_bot.webserver.routes.*
|
||||
import java.time.Duration
|
||||
@ -34,8 +33,6 @@ const val naverMeAPIURL = "https://openapi.naver.com/v1/nid/me"
|
||||
|
||||
val redirects = mutableMapOf<String, String>()
|
||||
|
||||
val logger = LoggerFactory.getLogger("ktorMain")
|
||||
|
||||
val server = embeddedServer(Netty, port = 8080, ) {
|
||||
install(WebSockets) {
|
||||
pingPeriod = Duration.ofSeconds(15)
|
||||
@ -296,7 +293,7 @@ suspend fun getDiscordUser(accessToken: String): DiscordMeAPI? {
|
||||
}
|
||||
|
||||
suspend fun getUserGuilds(accessToken: String): List<DiscordGuildListAPI> {
|
||||
val response = applicationHttpClient.get("https://discord.com/users/@me/guilds") {
|
||||
val response = applicationHttpClient.get("https://discord.com/api/users/@me/guilds") {
|
||||
headers {
|
||||
append(HttpHeaders.Authorization, "Bearer $accessToken")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user