Search Results for

    Show / Hide Table of Contents

    Class LavalinkExtension

    The lavalink extension.

    Inheritance
    System.Object
    BaseExtension
    LavalinkExtension
    Inherited Members
    BaseExtension.Client
    Namespace: DisCatSharp.Lavalink
    Assembly: DisCatSharp.Lavalink.dll
    Syntax
    public sealed class LavalinkExtension : BaseExtension

    Properties

    | Improve this Doc View Source

    ConnectedNodes

    Gets a dictionary of connected Lavalink nodes for the extension.

    Declaration
    public IReadOnlyDictionary<ConnectionEndpoint, LavalinkNodeConnection> ConnectedNodes { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<ConnectionEndpoint, LavalinkNodeConnection>

    Methods

    | Improve this Doc View Source

    ConnectAsync(LavalinkConfiguration)

    Connect to a Lavalink node.

    Declaration
    public async Task<LavalinkNodeConnection> ConnectAsync(LavalinkConfiguration config)
    Parameters
    Type Name Description
    LavalinkConfiguration config

    Lavalink client configuration.

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

    The established Lavalink connection.

    | Improve this Doc View Source

    GetGuildConnection(DiscordGuild)

    Gets a Lavalink guild connection from a DiscordGuild.

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

    The guild the connection is on.

    Returns
    Type Description
    LavalinkGuildConnection

    The found guild connection, or null if one could not be found.

    | Improve this Doc View Source

    GetIdealNodeConnection(DiscordVoiceRegion)

    Gets a Lavalink node connection based on load balancing and an optional voice region.

    Declaration
    public LavalinkNodeConnection GetIdealNodeConnection(DiscordVoiceRegion region = null)
    Parameters
    Type Name Description
    DiscordVoiceRegion region

    The region to compare with the node's Region, if any.

    Returns
    Type Description
    LavalinkNodeConnection

    The least load affected node connection, or null if no nodes are present.

    | Improve this Doc View Source

    GetNodeConnection(ConnectionEndpoint)

    Gets the Lavalink node connection for the specified endpoint.

    Declaration
    public LavalinkNodeConnection GetNodeConnection(ConnectionEndpoint endpoint)
    Parameters
    Type Name Description
    ConnectionEndpoint endpoint

    Endpoint at which the node resides.

    Returns
    Type Description
    LavalinkNodeConnection

    Lavalink node connection.

    | Improve this Doc View Source

    Setup(DiscordClient)

    DO NOT USE THIS MANUALLY.

    Declaration
    protected override void Setup(DiscordClient client)
    Parameters
    Type Name Description
    DiscordClient client

    DO NOT USE THIS MANUALLY.

    Overrides
    BaseExtension.Setup(DiscordClient)
    Exceptions
    Type Condition
    System.InvalidOperationException

    Events

    | Improve this Doc View Source

    NodeDisconnected

    Triggered whenever a node disconnects.

    Declaration
    public event AsyncEventHandler<LavalinkNodeConnection, NodeDisconnectedEventArgs> NodeDisconnected
    Event Type
    Type Description
    AsyncEventHandler<LavalinkNodeConnection, NodeDisconnectedEventArgs>

    Extension Methods

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