CoroutinesEventBus add.

- koin dependency injection add
- EventDispatcher fix
This commit is contained in:
dalbodeule
2024-07-31 16:14:58 +09:00
parent 99ec9ba7a0
commit 180dbc85bf
9 changed files with 105 additions and 58 deletions

View File

@@ -3,12 +3,15 @@ package space.mori.chzzk_bot
import io.github.cdimascio.dotenv.dotenv
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import org.koin.core.context.GlobalContext.startKoin
import org.koin.dsl.module
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import space.mori.chzzk_bot.chatbot.chzzk.ChzzkHandler
import space.mori.chzzk_bot.chatbot.discord.Discord
import space.mori.chzzk_bot.chatbot.chzzk.Connector as ChzzkConnector
import space.mori.chzzk_bot.common.Connector
import space.mori.chzzk_bot.common.events.CoroutinesEventBus
import space.mori.chzzk_bot.webserver.start
import space.mori.chzzk_bot.webserver.stop
import java.util.concurrent.TimeUnit
@@ -26,6 +29,13 @@ val chzzkConnector = ChzzkConnector
val chzzkHandler = ChzzkHandler
fun main(args: Array<String>) {
val dispatcher = module {
single { CoroutinesEventBus() }
}
startKoin {
modules(dispatcher)
}
discord.enable()
chzzkHandler.enable()
chzzkHandler.runStreamInfo()