LavalinkPlayer class
Provides methods to control and get information about a Lavalink Player in a voice channel.
Constructors
- LavalinkPlayer({required NyxxGateway client, required LavalinkClient lavalinkClient, required LavalinkPlugin plugin, required Snowflake guildId})
- Create a new LavalinkPlayer.
Properties
- client → NyxxGateway
-
The
NyxxGateway
client this player is attached to.final - currentTrack → Track?
-
The currently playing track.
no setter
- guildId → Snowflake
-
The ID of this player's guild.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lavalinkClient → LavalinkClient
-
The LavalinkClient this player is attached to.
final
-
onTrackEnd
→ Stream<
TrackEndEvent> -
A stream of TrackEndEvents emitted by this player.
no setter
-
onTrackException
→ Stream<
TrackExceptionEvent> -
A stream of TrackExceptionEvents emitted by this player.
no setter
-
onTrackStart
→ Stream<
TrackStartEvent> -
A stream of TrackStartEvents emitted by this player.
no setter
-
onTrackStuck
→ Stream<
TrackStuckEvent> -
A stream of TrackStuckEvents emitted by this player.
no setter
-
onUpdate
→ Stream<
PlayerUpdateMessage> -
A stream of PlayerUpdateMessages emitted by this player.
no setter
-
onWebsocketClosed
→ Stream<
WebSocketClosedEvent> -
A stream of WebSocketClosedEvents emitted by this player.
no setter
- plugin → LavalinkPlugin
-
The LavalinkPlugin this player is attached to.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → PlayerState
-
The current state of this player.
no setter
Methods
-
disconnect(
) → Future< void> - Disconnect this player from the voice channel and destroy it.
-
fetchPlayer(
) → Future< Player> - Fetch the underlying Lavalink Player this LavalinkPlayer instance represents.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → Future< void> - Pause the currently playing track.
-
play(
Track track) → Future< void> - Play a track in the voice channel.
-
playEncoded(
String encodedTrack) → Future< void> - Play a track in the voice channel using the track's encoded representation.
-
playIdentifier(
String identifier) → Future< void> - Play a track in the voice channel by the track's identifier.
-
resume(
) → Future< void> - Resume playing the current track.
-
seekTo(
Duration position) → Future< void> -
Seek to the provided
position
in the currently playing track. -
setFilters(
Filters filters) → Future< void> - Set the filters this player uses.
-
setVolume(
int volume) → Future< void> - Set this player's volume.
-
stopPlaying(
) → Future< void> - Stop the currently playing track.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited