Merge pull request #44 from dalbodeule/develop

some logic changed.
This commit is contained in:
JinU Choi 2024-08-07 13:18:05 +09:00 committed by GitHub
commit 8d50d1c3aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -161,19 +161,24 @@ class UserHandler(
streamStartTime = status.content?.openDate?.let { convertChzzkDateToLocalDateTime(it) } streamStartTime = status.content?.openDate?.let { convertChzzkDateToLocalDateTime(it) }
CoroutineScope(Dispatchers.Default).launch { CoroutineScope(Dispatchers.Default).launch {
if(!_isActive) {
when(TimerConfigService.getConfig(UserService.getUser(channel.channelId)!!)?.option) { when(TimerConfigService.getConfig(UserService.getUser(channel.channelId)!!)?.option) {
TimerType.UPTIME.value -> dispatcher.post(TimerEvent( TimerType.UPTIME.value -> dispatcher.post(
TimerEvent(
channel.channelId, channel.channelId,
TimerType.UPTIME, TimerType.UPTIME,
getUptime(streamStartTime!!) getUptime(streamStartTime!!)
)) )
else -> dispatcher.post(TimerEvent( )
else -> dispatcher.post(
TimerEvent(
channel.channelId, channel.channelId,
TimerType.REMOVE, TimerType.REMOVE,
"" ""
)) )
)
} }
if(!_isActive) {
delay(5000L) delay(5000L)
try { try {
listener.sendChat("${user.username} 님! 오늘도 열심히 방송하세요!") listener.sendChat("${user.username} 님! 오늘도 열심히 방송하세요!")