Class DiscordClientExtensions
Inheritance
Namespace: DSharpPlus.Lavalink
Assembly: cs.temp.dll.dll
Syntax
public static class DiscordClientExtensions
Methods
ConnectAsync(DiscordChannel, LavalinkNodeConnection)
Connects to this voice channel using Lavalink.
Declaration
public static Task ConnectAsync(this DiscordChannel channel, LavalinkNodeConnection node)
Parameters
Type | Name | Description |
---|---|---|
DiscordChannel | channel | Channel to connect to. |
LavalinkNodeConnection | node | Lavalink node to connect through. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | If successful, the Lavalink client. |
GetLavalink(DiscordClient)
Gets the active instance of the Lavalink client for the DiscordClient.
Declaration
public static LavalinkExtension GetLavalink(this DiscordClient client)
Parameters
Type | Name | Description |
---|---|---|
DiscordClient | client | Discord client to get Lavalink instance for. |
Returns
Type | Description |
---|---|
LavalinkExtension | Lavalink client instance. |
GetLavalinkAsync(DiscordShardedClient)
Retrieves a LavalinkExtension instance for each shard.
Declaration
public static Task<IReadOnlyDictionary<int, LavalinkExtension>> GetLavalinkAsync(this DiscordShardedClient client)
Parameters
Type | Name | Description |
---|---|---|
DiscordShardedClient | client | The shard client to retrieve LavalinkExtension instances from. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyDictionary<System.Int32, LavalinkExtension>> | A dictionary containing LavalinkExtension instances for each shard. |
UseLavalink(DiscordClient)
Creates a new Lavalink client with specified settings.
Declaration
public static LavalinkExtension UseLavalink(this DiscordClient client)
Parameters
Type | Name | Description |
---|---|---|
DiscordClient | client | Discord client to create Lavalink instance for. |
Returns
Type | Description |
---|---|
LavalinkExtension | Lavalink client instance. |
UseLavalinkAsync(DiscordShardedClient)
Creates new Lavalink clients on all shards in a given sharded client.
Declaration
public static Task<IReadOnlyDictionary<int, LavalinkExtension>> UseLavalinkAsync(this DiscordShardedClient client)
Parameters
Type | Name | Description |
---|---|---|
DiscordShardedClient | client | Discord sharded client to create Lavalink instances for. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IReadOnlyDictionary<System.Int32, LavalinkExtension>> | A dictionary of created Lavalink clients. |