Constructor DiscordVoiceConnection
| Improve this Doc View SourceDiscordVoiceConnection(Shard, Snowflake)
Creates a new voice connection for a guild managed by the given shard.
Declaration
public DiscordVoiceConnection(Shard shard, Snowflake guildId)
Parameters
| Type | Name | Description |
|---|---|---|
| Shard | shard | The shard that manages the guild. |
| Snowflake | guildId | The guild to connect to. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown if the given shard is not running. |
DiscordVoiceConnection(IGatewayVoiceBridge, Snowflake, Snowflake)
Creates a new voice connection for a guild.
Declaration
public DiscordVoiceConnection(IGatewayVoiceBridge bridge, Snowflake userId, Snowflake guildId)
Parameters
| Type | Name | Description |
|---|---|---|
| IGatewayVoiceBridge | bridge | A bridge between the Gateway connection that serves the guild and this voice connection. |
| Snowflake | userId | The user ID of the application/bot. |
| Snowflake | guildId | The guild to connect to. |
Remarks
This constructor should only be used if you are implementing IGatewayVoiceBridge yourself to create a bridge between your application's voice connections and the Gateway connection. If the voice connections live in the same process as the Gateway connection, prefer the simpler constructor that takes a shard instance.