Discore
Show / Hide Table of Contents

Method UpdateVoiceStateAsync

| Improve this Doc View Source

UpdateVoiceStateAsync(Snowflake, bool, bool, CancellationToken?)

Moves channels and/or changes the applications self muted/deafened states.

Declaration
public Task UpdateVoiceStateAsync(Snowflake voiceChannelId, bool isMute = false, bool isDeaf = false, CancellationToken? cancellationToken = null)
Parameters
Type Name Description
Snowflake voiceChannelId

The ID of the voice channel to move to. Specify the channel the application is already in to stay there.

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
Remarks

Do not pass an empty snowflake for the voice channel ID to disconnect. Instead, call DisconnectAsync(CancellationToken?).

Exceptions
Type Condition
ArgumentException

Thrown if voiceChannelId is an empty snowflake.

InvalidOperationException

Thrown if the parent Gateway connection is no longer valid.

OperationCanceledException

Thrown if the cancellation token is cancelled.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX