diff --git a/example/src/commonMain/kotlin/Lavakord.kt b/example/src/commonMain/kotlin/Lavakord.kt index 52e7fa98..d016fdd7 100644 --- a/example/src/commonMain/kotlin/Lavakord.kt +++ b/example/src/commonMain/kotlin/Lavakord.kt @@ -13,9 +13,8 @@ import dev.kord.core.on import dev.kord.gateway.Intent import dev.kord.gateway.PrivilegedIntent import dev.kord.rest.builder.interaction.string -import dev.schlaubi.lavakord.plugins.lavasrc.lavaSrcInfo +import dev.schlaubi.lavakord.audio.Event import dev.schlaubi.lavakord.audio.Link -import dev.schlaubi.lavakord.audio.TrackEvent import dev.schlaubi.lavakord.audio.on import dev.schlaubi.lavakord.kord.getLink import dev.schlaubi.lavakord.kord.lavakord @@ -50,7 +49,7 @@ suspend fun main() { } } - lavalink.addNode("wss://joachim.lava-hosts.schlaubi.net", "jcdrNb7Y8D8TTo6D64x&msiA3CzD") + lavalink.addNode("ws://localhost:2333", "youshallnotpass") kord.on { val ack = interaction.deferPublicResponse() @@ -61,9 +60,9 @@ suspend fun main() { val followUpCreator = FollowupPermittingInteractionResponseBehavior( interaction.applicationId, interaction.token, interaction.kord, interaction.supplier ) - player.on { + player.on { try { - followUpCreator.createEphemeralFollowup { content = "Event: ${this@on.track.lavaSrcInfo}" } + followUpCreator.createEphemeralFollowup { content = "Event: ${this@on}" } } catch (e: Exception) { e.printStackTrace() } diff --git a/java/src/main/kotlin/dev/schlaubi/lavakord/interop/JavaEventSource.kt b/java/src/main/kotlin/dev/schlaubi/lavakord/interop/JavaEventSource.kt index 8cb6c6f0..22af8d57 100644 --- a/java/src/main/kotlin/dev/schlaubi/lavakord/interop/JavaEventSource.kt +++ b/java/src/main/kotlin/dev/schlaubi/lavakord/interop/JavaEventSource.kt @@ -28,7 +28,9 @@ public interface JavaEventSource { */ public fun on(eventType: Class, handler: Consumer) { events.subscribe(object : Subscriber { - override fun onSubscribe(subscription: Flow.Subscription) = Unit + override fun onSubscribe(subscription: Flow.Subscription) { + subscription.request(Long.MAX_VALUE) + } override fun onError(throwable: Throwable) { // This in theory should never happen