Skip to content

Commit

Permalink
Fix version check
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Jul 20, 2023
1 parent 2c61697 commit f5cb9d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "dev.schlaubi.lavakord"
version = "5.0.2"
version = "5.0.3"

allprojects {
repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import dev.schlaubi.lavakord.Plugin
import dev.schlaubi.lavakord.audio.Event
import dev.schlaubi.lavakord.audio.Node
import dev.schlaubi.lavakord.rest.getInfo
import dev.schlaubi.lavakord.rest.getVersion
import dev.schlaubi.lavakord.rest.routes.V4Api
import dev.schlaubi.lavakord.rest.updateSession
import io.ktor.client.plugins.*
Expand Down Expand Up @@ -67,9 +68,15 @@ internal class NodeImpl(
get() = eventPublisher.asSharedFlow()

internal suspend fun check() {
val (version, _, _, _, _, _, _, plugins) = getInfo()
if(version.major != 4) {
error("Unsupported Lavalink version (${version.major} on node $name")
val version = getVersion()
val (_, _, _, _, _, _, _, plugins) = getInfo()
if(version.startsWith("4")) {
val message = "Unsupported Lavalink version (${version} on node $name"
if ("SNAPSHOT" in message){
LOG.warn { message }
} else {
error(message)
}
}
val pluginMap = plugins.plugins.associate { (name, version) -> name to version }
val installedPlugins = lavakord.options.plugins.plugins
Expand Down

0 comments on commit f5cb9d1

Please sign in to comment.