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