Search Results for

    Show / Hide Table of Contents

    Class LavalinkNodeConnection

    Represents a connection to a Lavalink node.

    Inheritance
    System.Object
    LavalinkNodeConnection
    Namespace: DisCatSharp.Lavalink
    Assembly: DisCatSharp.Lavalink.dll
    Syntax
    public sealed class LavalinkNodeConnection

    Properties

    | Improve this Doc View Source

    ConnectedGuilds

    Gets a dictionary of Lavalink guild connections for this node.

    Declaration
    public IReadOnlyDictionary<ulong, LavalinkGuildConnection> ConnectedGuilds { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<System.UInt64, LavalinkGuildConnection>
    | Improve this Doc View Source

    Discord

    Gets the Discord client this node connection belongs to.

    Declaration
    public DiscordClient Discord { get; }
    Property Value
    Type Description
    DiscordClient
    | Improve this Doc View Source

    IsConnected

    Gets whether the client is connected to Lavalink.

    Declaration
    public bool IsConnected { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    NodeEndpoint

    Gets the remote endpoint of this Lavalink node connection.

    Declaration
    public ConnectionEndpoint NodeEndpoint { get; }
    Property Value
    Type Description
    ConnectionEndpoint
    | Improve this Doc View Source

    Parent

    Gets the parent extension which this node connection belongs to.

    Declaration
    public LavalinkExtension Parent { get; }
    Property Value
    Type Description
    LavalinkExtension
    | Improve this Doc View Source

    Rest

    Gets the REST client for this Lavalink connection.

    Declaration
    public LavalinkRestClient Rest { get; }
    Property Value
    Type Description
    LavalinkRestClient
    | Improve this Doc View Source

    Statistics

    Gets the current resource usage statistics.

    Declaration
    public LavalinkStatistics Statistics { get; }
    Property Value
    Type Description
    LavalinkStatistics

    Methods

    | Improve this Doc View Source

    ConnectAsync(DiscordChannel)

    Connects this Lavalink node to specified Discord channel.

    Declaration
    public async Task<LavalinkGuildConnection> ConnectAsync(DiscordChannel channel)
    Parameters
    Type Name Description
    DiscordChannel channel

    Voice channel to connect to.

    Returns
    Type Description
    System.Threading.Tasks.Task<LavalinkGuildConnection>

    Channel connection, which allows for playback control.

    | Improve this Doc View Source

    GetGuildConnection(DiscordGuild)

    Gets a Lavalink connection to specified Discord channel.

    Declaration
    public LavalinkGuildConnection GetGuildConnection(DiscordGuild guild)
    Parameters
    Type Name Description
    DiscordGuild guild

    Guild to get connection for.

    Returns
    Type Description
    LavalinkGuildConnection

    Channel connection, which allows for playback control.

    | Improve this Doc View Source

    StopAsync()

    Stops this Lavalink node connection and frees resources.

    Declaration
    public async Task StopAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    Events

    | Improve this Doc View Source

    Disconnected

    Triggered when this node disconnects.

    Declaration
    public event AsyncEventHandler<LavalinkNodeConnection, NodeDisconnectedEventArgs> Disconnected
    Event Type
    Type Description
    AsyncEventHandler<LavalinkNodeConnection, NodeDisconnectedEventArgs>
    | Improve this Doc View Source

    LavalinkSocketErrored

    Triggered whenever Lavalink WebSocket throws an exception.

    Declaration
    public event AsyncEventHandler<LavalinkNodeConnection, SocketErrorEventArgs> LavalinkSocketErrored
    Event Type
    Type Description
    AsyncEventHandler<LavalinkNodeConnection, SocketErrorEventArgs>
    | Improve this Doc View Source

    PlaybackFinished

    Triggered whenever playback of a track finishes.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, TrackFinishEventArgs> PlaybackFinished
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, TrackFinishEventArgs>
    | Improve this Doc View Source

    PlaybackStarted

    Triggered whenever playback of a track starts.

    This is only available for version 3.3.1 and greater.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, TrackStartEventArgs> PlaybackStarted
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, TrackStartEventArgs>
    | Improve this Doc View Source

    PlayerUpdated

    Triggered whenever any of the players on this node is updated.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, PlayerUpdateEventArgs> PlayerUpdated
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, PlayerUpdateEventArgs>
    | Improve this Doc View Source

    StatisticsReceived

    Triggered when this node receives a statistics update.

    Declaration
    public event AsyncEventHandler<LavalinkNodeConnection, StatisticsReceivedEventArgs> StatisticsReceived
    Event Type
    Type Description
    AsyncEventHandler<LavalinkNodeConnection, StatisticsReceivedEventArgs>
    | Improve this Doc View Source

    TrackException

    Triggered whenever playback of a track encounters an error.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, TrackExceptionEventArgs> TrackException
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, TrackExceptionEventArgs>
    | Improve this Doc View Source

    TrackStuck

    Triggered whenever playback of a track gets stuck.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, TrackStuckEventArgs> TrackStuck
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, TrackStuckEventArgs>

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems