login method changed to chzzk login

This commit is contained in:
dalbodeule
2025-01-08 23:13:04 +09:00
parent eccf1a29bc
commit d3ed6c2d86
10 changed files with 175 additions and 118 deletions

View File

@@ -39,7 +39,7 @@ object ChzzkHandler {
fun enable() {
botUid = chzzk.loggedUser.userId
UserService.getAllUsers().map {
if(it.token != null && !it.isDisabled)
if(!it.isDisabled)
chzzk.getChannel(it.token)?.let { token -> addUser(token, it) }
}

View File

@@ -42,7 +42,7 @@ class MessageHandler(
if(it.type == SongType.STREAM_OFF) {
val user = UserService.getUser(channel.channelId)
if(! user?.let { usr -> SongListService.getSong(usr) }.isNullOrEmpty()) {
SongListService.deleteUser(user!!)
SongListService.deleteUser(user)
}
}
}
@@ -161,7 +161,7 @@ class MessageHandler(
CoroutineScope(Dispatchers.Default).launch {
dispatcher.post(
TimerEvent(
user.token!!,
user.token,
TimerType.UPTIME,
getUptime(handler.streamStartTime!!)
)
@@ -171,7 +171,7 @@ class MessageHandler(
"삭제" -> {
logger.debug("${user.token} / 삭제")
CoroutineScope(Dispatchers.Default).launch {
dispatcher.post(TimerEvent(user.token!!, TimerType.REMOVE, ""))
dispatcher.post(TimerEvent(user.token, TimerType.REMOVE, ""))
}
}
"설정" -> {
@@ -195,7 +195,7 @@ class MessageHandler(
val timestamp = currentTime.plus(time.toLong(), ChronoUnit.MINUTES)
CoroutineScope(Dispatchers.Default).launch {
dispatcher.post(TimerEvent(user.token!!, TimerType.TIMER, timestamp.toString()))
dispatcher.post(TimerEvent(user.token, TimerType.TIMER, timestamp.toString()))
}
} catch (e: NumberFormatException) {
listener.sendChat("!타이머/숫자 형식으로 적어주세요! 단위: 분")
@@ -267,7 +267,7 @@ class MessageHandler(
CoroutineScope(Dispatchers.Default).launch {
dispatcher.post(
SongEvent(
user.token!!,
user.token,
SongType.ADD,
msg.userId,
null,