use a cooler event handler for events (async)
This commit is contained in:
parent
0366cbbbd8
commit
1157eb50de
@ -20,6 +20,7 @@ dependencies {
|
|||||||
implementation(libs.kx.ser)
|
implementation(libs.kx.ser)
|
||||||
implementation(libs.kx.coroutines)
|
implementation(libs.kx.coroutines)
|
||||||
implementation(libs.twitch4j)
|
implementation(libs.twitch4j)
|
||||||
|
implementation(libs.events4j)
|
||||||
implementation(libs.kmongo)
|
implementation(libs.kmongo)
|
||||||
|
|
||||||
// Logging dependencies
|
// Logging dependencies
|
||||||
|
@ -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" }
|
logback-groovy = { module = "io.github.virtualdogbert:logback-groovy-config", version.ref = "logback-groovy" }
|
||||||
logging = { module = "io.github.oshai:kotlin-logging", version.ref = "logging" }
|
logging = { module = "io.github.oshai:kotlin-logging", version.ref = "logging" }
|
||||||
twitch4j = { module = "com.github.twitch4j:twitch4j", version.ref = "twitch4j" }
|
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"}
|
kmongo = { module="org.litote.kmongo:kmongo-coroutine-serialization", version.ref = "kmongo"}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
package dev.jansel.feixiao
|
package dev.jansel.feixiao
|
||||||
|
|
||||||
|
import com.github.philippheuer.events4j.reactor.ReactorEventHandler
|
||||||
import com.github.twitch4j.TwitchClient
|
import com.github.twitch4j.TwitchClient
|
||||||
import com.github.twitch4j.TwitchClientBuilder
|
import com.github.twitch4j.TwitchClientBuilder
|
||||||
import com.github.twitch4j.events.ChannelGoLiveEvent
|
import com.github.twitch4j.events.ChannelGoLiveEvent
|
||||||
@ -31,6 +32,7 @@ suspend fun main() {
|
|||||||
.withEnableHelix(true)
|
.withEnableHelix(true)
|
||||||
.withClientId(twitchcid)
|
.withClientId(twitchcid)
|
||||||
.withClientSecret(twitchcs)
|
.withClientSecret(twitchcs)
|
||||||
|
.withDefaultEventHandler(ReactorEventHandler::class.java)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
twitchClient!!.eventManager.onEvent(ChannelGoLiveEvent::class.java) {
|
twitchClient!!.eventManager.onEvent(ChannelGoLiveEvent::class.java) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user