Table of Contents

Class LavalinkGuildPlayer

Namespace
DisCatSharp.Lavalink
Assembly
DisCatSharp.Lavalink.dll

Represents a guild player based on a LavalinkPlayer.

public sealed class LavalinkGuildPlayer
Inheritance
LavalinkGuildPlayer
Inherited Members

Properties

Channel

Gets the current channel this player is in.

ChannelId

Gets the current channel id.

CurrentTrack

Gets the current track.

CurrentUsers

Gets a list of current user in the Channel.

Discord

Gets the discord client.

Guild

Gets the guild this player is attached to.

GuildId

Gets the current guild id.

IsConnected

Gets whether this player is currently connected.

Ping

Gets the current ping.

Player

Gets the lavalink player.

Queue

Gets the queue.

Session

Gets the session this player is attached to.

TrackPosition

Gets the current track position.

Methods

AddToQueue(LavalinkPlaylist)

Adds all tracks from a Lavalink playlist to the queue.

AddToQueue(LavalinkTrack)

Adds a Lavalink track to the queue.

AddToQueueAt(int, LavalinkTrack)

Inserts a track at the specified index in the queue.

AddToQueueAt(int, IEnumerable<LavalinkTrack>)

Inserts a range of tracks at the specified index in the queue.

ClearQueue()

Clears all tracks from the queue.

DecodeTrackAsync(string)

Decodes an encoded LavalinkTrack.

Might not work with some pre 4.0 tracks.

DecodeTracksAsync(IEnumerable<string>)

Decodes encoded LavalinkTracks.

Might not work with pre 4.0 tracks.

DisconnectAsync()

Disconnect the guild player from the channel.

GetLyricsAsync(bool)

Gets the lyrics for the currently playing track.

LoadTracksAsync(LavalinkSearchType, string)

Loads tracks by identifier. Returns a dynamic object you have to parse with (Type)Result.

LoadTracksAsync(string)

Loads tracks by identifier. Returns a dynamic object you have to parse with (Type)Result.

PauseAsync()

Pauses the player.

PlayAsync(LavalinkTrack)

Plays a track.

PlayAsync(string)

Plays a song by its identifier.

PlayDirectUrlAsync(string)

Directly plays a song by url.

PlayEncodedAsync(string)

Plays a song by its encoded track string.

PlayPartialAsync(LavalinkTrack, TimeSpan, TimeSpan)

Plays a track partially with a start and end-time.

PlayPartialAsync(string, TimeSpan, TimeSpan)

Plays a song partially by its identifier with a start and end-time.

PlayPartialEncodedAsync(string, TimeSpan, TimeSpan)

Plays a song by its encoded track string with a start and end-time.

PlayQueue()

Starts playing the next track in the queue.

RemoveFromQueue(LavalinkTrack)

Removes the specified track from the queue.

RemoveFromQueue(string)

Removes the track with the specified title (identifier) from the queue.

RemoveFromQueueAt(int)

Removes the track at the specified index from the queue.

RemoveFromQueueAtRange(int, int)

Removes a range of tracks from the queue.

ResumeAsync()

Resumes the player.

ReverseQueue()

Reverses the order of the tracks in the queue.

SeekAsync(int)

Seeks the player to the position in seconds.

SeekAsync(TimeSpan)

Seeks the player to the position.

SetRepeatMode(RepeatMode)

Sets the repeat mode for the queue.

SetVolumeAsync(int)

Modifies the volume of the player.

ShuffleQueue()

Shuffles the tracks in the queue.

SkipAsync()

Skips the current track.

StopAsync()

Stops the player.

SwitchChannelAsync(DiscordChannel, bool)

Switches the player to a new channel.

TryPeekQueue(out LavalinkTrack?)

Attempts to retrieve the next track in the queue without removing it.

UpdateAsync(Action<LavalinkPlayerUpdateModel>)

Updates the LavalinkPlayer.

Events

StateUpdated

Triggers when a player state updated.

TrackEnded

Triggers when a track ended.

TrackException

Triggers when a track throws an exception.

TrackStarted

Triggers when a track started.

TrackStuck

Triggers when a track gets stuck.