mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
commit
18d28262d1
@ -88,8 +88,7 @@ val server = embeddedServer(Netty, port = 8080, ) {
|
||||
}.body()
|
||||
|
||||
call.sessions.set(userInfo.response?.let { profile ->
|
||||
UserSession(state,
|
||||
profile.id, profile.nickname, profile.profile_image)
|
||||
UserSession(state, profile.id)
|
||||
})
|
||||
|
||||
redirects[state]?.let { redirect ->
|
||||
@ -148,16 +147,12 @@ fun stop() {
|
||||
@Serializable
|
||||
data class UserSession(
|
||||
val state: String,
|
||||
val id: String,
|
||||
val nickname: String,
|
||||
val profileImage: String
|
||||
val id: String
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class NaverMeAPI(
|
||||
val id: String,
|
||||
val nickname: String,
|
||||
val profile_image: String
|
||||
val id: String
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
@ -91,11 +91,15 @@ fun Routing.apiRoutes() {
|
||||
println(session)
|
||||
var user = UserService.getUserWithNaverId(session.id)
|
||||
if(user == null) {
|
||||
user = UserService.saveUser(session.nickname, session.id)
|
||||
user = UserService.saveUser("임시닉네임", session.id)
|
||||
}
|
||||
val songConfig = SongConfigService.getConfig(user)
|
||||
val status = user.token?.let { it1 -> getStreamInfo(it1) }
|
||||
|
||||
if (user.username == "임시닉네임") {
|
||||
status?.content?.channel?.let { it1 -> UserService.updateUser(user, it1.channelId, it1.channelName) }
|
||||
}
|
||||
|
||||
if(status?.content == null) {
|
||||
call.respondText(user.naverId, status = HttpStatusCode.NotFound)
|
||||
return@get
|
||||
|
Loading…
x
Reference in New Issue
Block a user