Method UpdateVoiceStateAsync
| Improve this Doc View SourceUpdateVoiceStateAsync(Snowflake, Snowflake?, bool, bool, CancellationToken?)
Joins, moves, or disconnects the application from a voice channel.
Declaration
Task UpdateVoiceStateAsync(Snowflake guildId, Snowflake? channelId, bool isMute = false, bool isDeaf = false, CancellationToken? cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Snowflake | guildId | The ID of the guild containing the voice channel. |
| Snowflake? | channelId | The ID of the voice channel to join/move to or null to disconnect from voice. |
| bool | isMute | Whether the application is self-mute. |
| bool | isDeaf | Whether the application is self-deafened. |
| CancellationToken? | cancellationToken | A token used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown if the voice state could not be updated due to a stateful issue related to the Gateway connection. |
| OperationCanceledException | Thrown if the cancellation token is cancelled. |