diff --git a/build.gradle.kts b/build.gradle.kts index d41bc9ec..242ce919 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "dev.schlaubi.lavakord" -version = "5.1.2" +version = "5.1.3" allprojects { repositories { diff --git a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/EventSource.kt b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/EventSource.kt index 6f8d4ef2..b229ff63 100644 --- a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/EventSource.kt +++ b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/EventSource.kt @@ -16,10 +16,8 @@ import kotlinx.coroutines.launch * @see EventSource.on */ public interface EventSource { - public val events: Flow public val coroutineScope: CoroutineScope - } /** diff --git a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/Link.kt b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/Link.kt index dc40b8e1..21f15af8 100644 --- a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/Link.kt +++ b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/Link.kt @@ -34,7 +34,7 @@ public interface Link { /** * Connects this link to the voice channel with the specified [voiceChannelId]. */ - public suspend fun Link.connect(voiceChannelId: String): Unit = connectAudio(voiceChannelId.toULong()) + public suspend fun connect(voiceChannelId: String): Unit = connectAudio(voiceChannelId.toULong()) /** * Disconnects from the currently connected voice channel. diff --git a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/player/Track.kt b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/player/Track.kt index 642be1a0..c469d580 100644 --- a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/player/Track.kt +++ b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/player/Track.kt @@ -55,6 +55,7 @@ public data class LavaplayerTrack( val isSeekable = !isStream val uri = if (reader.readBoolean()) reader.readUTF() else null val source = reader.readUTF() + reader.discard((reader.availableForRead - Long.SIZE_BYTES).toLong()) val position = reader.readLong() return LavaplayerTrack( diff --git a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/rest/InternalLinkExtensions.kt b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/rest/InternalLinkExtensions.kt index 4ef05764..a91621df 100644 --- a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/rest/InternalLinkExtensions.kt +++ b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/rest/InternalLinkExtensions.kt @@ -76,7 +76,8 @@ public suspend inline fun RestNode.request( @PublishedApi internal val RestNode.restClient: HttpClient get() { - val lavakord = this.lavakord as? AbstractLavakord ?: error("Only supported on default implementation") + val lavakord = this.lavakord as? AbstractLavakord + ?: error("Only supported on default implementation") return lavakord.restClient } diff --git a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/rest/LinkTrackExtensions.kt b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/rest/LinkTrackExtensions.kt index 84802626..99abbd32 100644 --- a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/rest/LinkTrackExtensions.kt +++ b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/rest/LinkTrackExtensions.kt @@ -48,5 +48,5 @@ public suspend fun RestNode.decodeTrack(base64: String): Track = get(V4Api.Decod * **Note:** This makes an API call, if you want to do this locally use [LavaplayerTrack.fromLavalink] */ public suspend fun RestNode.decodeTracks(tracks: Iterable): List = post(V4Api.DecodeTrack()) { - setBody(tracks) + setBody(tracks.toList()) } diff --git a/jda/src/jvmMain/kotlin/dev/schlaubi/lavakord/jda/JDA.kt b/jda/src/jvmMain/kotlin/dev/schlaubi/lavakord/jda/JDA.kt index dafcaa5b..f06dfea2 100644 --- a/jda/src/jvmMain/kotlin/dev/schlaubi/lavakord/jda/JDA.kt +++ b/jda/src/jvmMain/kotlin/dev/schlaubi/lavakord/jda/JDA.kt @@ -14,6 +14,11 @@ import net.dv8tion.jda.api.sharding.ShardManager */ public interface LavakordJdaBase { public val lavakord: LavaKord + + /** + * Destructuring accessor for [lavakord]. + */ + public operator fun component1(): LavaKord = lavakord } /** @@ -23,6 +28,11 @@ public interface LavakordJdaBase { */ public interface LJDA : LavakordJdaBase { public val jda: JDA + + /** + * Destructuring accessor for [jda]. + */ + public operator fun component2(): JDA = jda } /** @@ -32,6 +42,11 @@ public interface LJDA : LavakordJdaBase { */ public interface LShardManager : LavakordJdaBase { public val shardManager: ShardManager + + /** + * Destructuring accessor for [shardManager]. + */ + public operator fun component2(): ShardManager = shardManager } /**