From accd4d19758ef0b5b62db32f3d05b4b2a88c333f Mon Sep 17 00:00:00 2001 From: Jannik Reimers Date: Thu, 28 Nov 2024 09:01:24 +0100 Subject: [PATCH] better loading system should work, will see it later during prod --- src/main/kotlin/dev/jansel/feixiao/App.kt | 10 +--------- src/main/kotlin/dev/jansel/feixiao/utils/Twitch.kt | 2 ++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/dev/jansel/feixiao/App.kt b/src/main/kotlin/dev/jansel/feixiao/App.kt index 16167c9..afdfc21 100644 --- a/src/main/kotlin/dev/jansel/feixiao/App.kt +++ b/src/main/kotlin/dev/jansel/feixiao/App.kt @@ -3,23 +3,15 @@ */ 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 -import dev.jansel.feixiao.database.collections.StreamerCollection import dev.jansel.feixiao.extensions.EventHooks import dev.jansel.feixiao.extensions.StreamerCommand import dev.jansel.feixiao.utils.database import dev.jansel.feixiao.utils.token -import dev.jansel.feixiao.utils.twitchcid -import dev.jansel.feixiao.utils.twitchcs -import dev.kord.core.entity.channel.GuildMessageChannel import dev.kordex.core.ExtensibleBot import dev.kordex.core.i18n.SupportedLocales import io.github.oshai.kotlinlogging.KotlinLogging -import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking +import dev.jansel.feixiao.utils.twitch var twitchClient: TwitchClient? = null val logger = KotlinLogging.logger { } diff --git a/src/main/kotlin/dev/jansel/feixiao/utils/Twitch.kt b/src/main/kotlin/dev/jansel/feixiao/utils/Twitch.kt index 6327551..07b3d2e 100644 --- a/src/main/kotlin/dev/jansel/feixiao/utils/Twitch.kt +++ b/src/main/kotlin/dev/jansel/feixiao/utils/Twitch.kt @@ -1,5 +1,6 @@ package dev.jansel.feixiao.utils +import com.github.philippheuer.events4j.reactor.ReactorEventHandler import com.github.twitch4j.TwitchClientBuilder import com.github.twitch4j.events.ChannelGoLiveEvent import dev.jansel.feixiao.botRef @@ -14,6 +15,7 @@ class Twitch : KordExKoinComponent { suspend fun init() { twitchClient = TwitchClientBuilder.builder() .withEnableHelix(true) + .withDefaultEventHandler(ReactorEventHandler::class.java) .withClientId(twitchcid) .withClientSecret(twitchcs) .build()