1
0

use a cooler event handler for events (async)

This commit is contained in:
Jannik Reimers 2024-11-24 03:24:01 +01:00
parent 0366cbbbd8
commit 1157eb50de
Signed by: jansel
GPG Key ID: 39C62D7D5233CFD0
3 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,7 @@ dependencies {
implementation(libs.kx.ser)
implementation(libs.kx.coroutines)
implementation(libs.twitch4j)
implementation(libs.events4j)
implementation(libs.kmongo)
// Logging dependencies

View File

@ -22,5 +22,5 @@ logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
logback-groovy = { module = "io.github.virtualdogbert:logback-groovy-config", version.ref = "logback-groovy" }
logging = { module = "io.github.oshai:kotlin-logging", version.ref = "logging" }
twitch4j = { module = "com.github.twitch4j:twitch4j", version.ref = "twitch4j" }
events4j = { module = "com.github.philippheuer.events4j:events4j-handler-simple", version.ref = "events4j" }
events4j = { module = "com.github.philippheuer.events4j:events4j-handler-reactor", version.ref = "events4j" }
kmongo = { module="org.litote.kmongo:kmongo-coroutine-serialization", version.ref = "kmongo"}

View File

@ -3,6 +3,7 @@
*/
package dev.jansel.feixiao
import com.github.philippheuer.events4j.reactor.ReactorEventHandler
import com.github.twitch4j.TwitchClient
import com.github.twitch4j.TwitchClientBuilder
import com.github.twitch4j.events.ChannelGoLiveEvent
@ -31,6 +32,7 @@ suspend fun main() {
.withEnableHelix(true)
.withClientId(twitchcid)
.withClientSecret(twitchcs)
.withDefaultEventHandler(ReactorEventHandler::class.java)
.build()
twitchClient!!.eventManager.onEvent(ChannelGoLiveEvent::class.java) {