Link

interface Link : CoroutineScope

Representation of a link between a Guild and a Lavalink node.

Types

Link copied to clipboard

Representation of different Link states.

Properties

Link copied to clipboard
Link copied to clipboard
abstract val guildId: ULong

the id of the Guild this Link is connected to

Link copied to clipboard
abstract val lastChannelId: ULong?

the id of the last channel this Link is connected to

Link copied to clipboard
abstract val lavakord: LavaKord

the LavaKord instance which created this link

Link copied to clipboard
abstract val node: Node

the Node which is currently used to play songs (Can be changed in case one node crashes)

Link copied to clipboard
abstract val player: Player

a Player to play audio

Link copied to clipboard
abstract val state: Link.State

the current State of this Link

Functions

Link copied to clipboard
suspend fun Link.addressStatus(): RoutePlannerStatus

Retrieves the current address status of the route planner api.

Link copied to clipboard
suspend fun Link.addressStatusOrNull(): RoutePlannerStatus?

Retrieves the current address status of the route planner api. Can be null if no Route planner is set

Link copied to clipboard
open suspend fun connect(voiceChannelId: String)

Connects this link to the voice channel with the specified voiceChannelId.

Link copied to clipboard
abstract suspend fun connectAudio(voiceChannelId: ULong)

Connects this link to the voice channel with the specified voiceChannelId

Link copied to clipboard
abstract suspend fun destroy()

Destroys this link (will no longer be usable).

Link copied to clipboard
abstract suspend fun disconnectAudio()

Disconnects from the currently connected voice channel.

Link copied to clipboard
suspend fun Link.loadItem(query: String): LoadResult

Loads an audio item from this Link.

Link copied to clipboard
abstract suspend fun onDisconnected()

Internal method that is called when the Discord voice states updates so the bot is no longer in a voice channel.

Link copied to clipboard
abstract suspend fun onNewSession(node: Node)

Called internally when this link is connected or reconnected to a new node without resuming, thereby creating a new session. This function may also be used if the link is moved to a new session.

Link copied to clipboard
suspend fun Link.unmarkAddress(address: String)

Unmarks the route planner address.

Link copied to clipboard
suspend fun Link.unmarkAllAddresses()

Unmarks all failed route planner addresses.