some logic changed.

This commit is contained in:
dalbodeule 2024-08-07 13:12:38 +09:00
parent 608ba49a71
commit de30e632e5
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65

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} 님! 오늘도 열심히 방송하세요!")