Package dev.arbjerg.lavalink.client
Class Link
-
- All Implemented Interfaces:
public final class Link
A "Link" for linking a guild id to a node. Mainly just a data class that contains some shortcuts to the node. You should never store a link as it might be replaced internally without you knowing.
-
-
Field Summary
Fields Modifier and Type Field Description private final LavalinkNode
node
private final LinkState
state
private final LavalinkPlayer
cachedPlayer
private final Long
guildId
-
Constructor Summary
Constructors Constructor Description Link(Long guildId, LavalinkNode node)
-
Method Summary
Modifier and Type Method Description final LavalinkNode
getNode()
final LinkState
getState()
The voice connection state of this link final LavalinkPlayer
getCachedPlayer()
final Long
getGuildId()
final Mono<LavalinkPlayer>
getPlayer()
Gets the player for this link. final Mono<Unit>
destroy()
Destroys this link, disconnecting the bot in the process. final Mono<LavalinkPlayer>
updatePlayer(Consumer<PlayerUpdateBuilder> updateConsumer)
final PlayerUpdateBuilder
createOrUpdatePlayer()
Creates or updates the player for this link. final Mono<LavalinkLoadResult>
loadItem(String identifier)
Load an item for the player. final Unit
onVoiceServerUpdate(VoiceState newVoiceState)
Boolean
equals(Object other)
Integer
hashCode()
-
-
Constructor Detail
-
Link
Link(Long guildId, LavalinkNode node)
-
-
Method Detail
-
getNode
final LavalinkNode getNode()
-
getCachedPlayer
final LavalinkPlayer getCachedPlayer()
-
getGuildId
final Long getGuildId()
-
getPlayer
final Mono<LavalinkPlayer> getPlayer()
Gets the player for this link. If the player is not cached, it will be retrieved or created on the server.
-
updatePlayer
final Mono<LavalinkPlayer> updatePlayer(Consumer<PlayerUpdateBuilder> updateConsumer)
-
createOrUpdatePlayer
final PlayerUpdateBuilder createOrUpdatePlayer()
Creates or updates the player for this link.
-
loadItem
final Mono<LavalinkLoadResult> loadItem(String identifier)
Load an item for the player.
- Parameters:
identifier
- The identifier (E.G.
-
onVoiceServerUpdate
final Unit onVoiceServerUpdate(VoiceState newVoiceState)
-
-
-
-