Table of Contents
API reference

Class LavalinkSession

Namespace
DisCatSharp.Lavalink
Assembly
DisCatSharp.Lavalink.dll

Represents a LavalinkSession.

public sealed class LavalinkSession
Inheritance
LavalinkSession
Inherited Members

Properties

Configuration

Gets the current LavalinkSessionConfiguration.

ConnectedPlayers

Gets a dictionary of Lavalink guild connections for this node.

Discord

Gets the Discord client this node connection belongs to.

IsConnected

Gets whether the client is connected to Lavalink.

NodeEndpoint

Gets the remote endpoint of this Lavalink node connection.

Statistics

Gets the current LavalinkStats.

Methods

ConfigureAsync(LavalinkSessionConfiguration, CancellationToken)

Configures the current lavalink session.

ConnectAsync(DiscordChannel, bool, bool, CancellationToken)

Connects to a DiscordChannel.

DecodeTrackAsync(string, CancellationToken)

Decodes an encoded LavalinkTrack.

Might not work with pre 3.0 tracks.

DecodeTracksAsync(IEnumerable<string>, CancellationToken)

Decodes encoded LavalinkTracks.

Might not work with pre 3.0 tracks.

DestroyAsync(CancellationToken)

Destroys the current session, disconnecting all players.

DestroyGuildPlayersAsync(CancellationToken)

Destroys all players.

GetBridgeOpusSource(ulong)

Gets the bridge-mode IExternalOpusSource for the specified guild, if available. Use this to feed a VoiceOutputController via SetMusicSourceAsync(IExternalOpusSource?, CancellationToken).

GetBridgeVoiceConnection(ulong)

Gets the bridge-mode VoiceConnection for the specified guild, if one is active.

GetGuildPlayer(DiscordGuild)

Gets the guild player attached to guild.

GetGuildPlayersAsync()

Gets all guild players.

GetLavalinkInfoAsync(CancellationToken)

Gets the lavalink server information.

GetLavalinkStatsAsync(CancellationToken)

Gets the lavalink server statistics.

GetLavalinkVersionAsync(CancellationToken)

Gets the lavalink server version

GetLyricsAsync(LavalinkTrack, bool, CancellationToken)

Gets the lyrics for a track.

GetLyricsForCurrentTrackAsync(string, ulong, bool, CancellationToken)

Gets the lyrics for a currently playing track.

GetPlayerAsync(DiscordGuild, CancellationToken)

Gets the lavalink player attached to guild.

Use GetGuildPlayer(DiscordGuild) if you want to interact with the actual player.

GetPlayersAsync(CancellationToken)

Gets all lavalink players.

Use GetGuildPlayersAsync() if you want to interact with the actual players.

LoadTracksAsync(LavalinkSearchType, string, CancellationToken)

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

LoadTracksAsync(string, CancellationToken)

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

RebindBridgeOpusSource(ulong, IExternalOpusSource, CancellationToken)

Rebinds the voice connection for the specified guild to a new Opus source. Typically used to insert a VoiceOutputController between the bridge source and the voice connection. The previous binding is cancelled before the new one starts.

Events

GuildPlayerDestroyed

Triggered when a LavalinkGuildPlayer gets destroyed.

LavalinkSocketErrored

Triggered whenever Lavalink WebSocket throws an exception.

StatsReceived

Triggered when a LavalinkStats are received.

WebsocketClosed

Triggered when the websocket to discord gets closed.