Class LavalinkExtension
Inherited Members
Namespace: DSharpPlus.Lavalink
Assembly: cs.temp.dll.dll
Syntax
public sealed class LavalinkExtension : BaseExtension
Properties
ConnectedNodes
Gets a dictionary of connected Lavalink nodes for the extension.
Declaration
public IReadOnlyDictionary<ConnectionEndpoint, LavalinkNodeConnection> ConnectedNodes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<ConnectionEndpoint, LavalinkNodeConnection> |
Methods
ConnectAsync(LavalinkConfiguration)
Connect to a Lavalink node.
Declaration
public 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. |
GetGuildConnection(DiscordGuild)
Gets a Lavalink guild connection from a
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. |
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. |
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. |
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
Events
NodeDisconnected
Triggered whenever a node disconnects.
Declaration
public event AsyncEventHandler<LavalinkNodeConnection, NodeDisconnectedEventArgs> NodeDisconnected
Event Type
Type | Description |
---|---|
AsyncEventHandler<LavalinkNodeConnection, NodeDisconnectedEventArgs> |