main.dev.schlaubi.lavakord.interop.JavaLavakord.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java Show documentation
Show all versions of java Show documentation
Coroutine based client for Lavalink (Kotlin and Java)
package dev.schlaubi.lavakord.interop
import dev.schlaubi.lavakord.LavaKord
import dev.schlaubi.lavakord.LavaKordOptions
import dev.schlaubi.lavakord.audio.Node
import java.net.URI
/**
* Java interface for [LavaKord].
* @see createJavaInterface
*/
public class JavaLavakord(private val parent: LavaKord) {
/**
* @see LavaKord.nodes
*/
public val nodes: List
get() = parent.nodes
/**
* @see LavaKord.userId
*/
public val userId: Long
get() = parent.userId.toLong()
/**
* @see LavaKord.options
*/
public val options: LavaKordOptions
get() = parent.options
/**
* @see LavaKord.getLink
*
* @see JavaLink
*/
public fun getLink(guildId: Long): JavaLink {
val link = parent.getLink(guildId.toULong())
return JavaLink(link)
}
/**
* @see LavaKord.addNode
*/
@JvmOverloads
public fun addNode(serverUri: URI, password: String, name: String? = null) {
parent.addNode(serverUri.toString(), password, name)
}
/**
* @see LavaKord.addNode
*/
@JvmOverloads
public fun addNode(serverUri: String, password: String, name: String? = null) {
parent.addNode(serverUri, password, name)
}
/**
* @see LavaKord.removeNode
*/
public fun removeNode(name: String): Unit = parent.removeNode(name)
/**
* @see LavaKord.removeNode
*/
public fun removeNode(node: Node): Unit = parent.removeNode(node)
}