From f29370a31fd7ee6c5bf498f670f8890055c62226 Mon Sep 17 00:00:00 2001 From: dalbodeule <11470513+dalbodeule@users.noreply.github.com> Date: Sun, 18 May 2025 09:24:11 +0900 Subject: [PATCH] [feature] timer debugs. --- .../chzzk_bot/chatbot/chzzk/ChzzkHandler.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/ChzzkHandler.kt b/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/ChzzkHandler.kt index a8cc596..3e330e3 100644 --- a/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/ChzzkHandler.kt +++ b/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/ChzzkHandler.kt @@ -237,6 +237,26 @@ class UserHandler( listener.on(SessionChatMessageEvent::class.java) { messageHandler.handle(it.message, user) } + + GlobalScope.launch { + val timer = TimerConfigService.getConfig(user) + if (timer?.option == TimerType.UPTIME.value) + dispatcher.post( + TimerEvent( + channel.channelId, + TimerType.UPTIME, + getUptime(streamStartTime!!) + ) + ) + else dispatcher.post( + TimerEvent( + channel.channelId, + TimerType.entries.firstOrNull { it.value == timer?.option } ?: TimerType.REMOVE, + null + ) + ) + } + } catch(e: Exception) { logger.error("Exception(${user.username}): ${e.stackTraceToString()}") throw RuntimeException("Exception: ${e.stackTraceToString()}")