All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.dev.schlaubi.lavakord.interop.JavaLavakord.kt Maven / Gradle / Ivy

There is a newer version: 7.1.0
Show newest version
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)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy