docs: add explanation to RunMode.Async in voice docs

This commit is contained in:
Christopher F
2018-10-19 17:52:36 -04:00
parent 88e66860a6
commit c7e7f7e51a

View File

@@ -36,6 +36,14 @@ To join a channel, simply await [ConnectAsync] on any instance of an
[!code-csharp[Joining a Channel](samples/joining_audio.cs)]
>[!WARNING]
>Commands which mutate voice states, such as those where you join/leave
>an audio channel, or send audio, should use [RunMode.Async]. RunMode.Async
>is necessary to prevent a feedback loop which will deadlock clients
>in their default configuration. If you know that you're running your
>commands in a different task than the gateway task, RunMode.Async is
>not required.
The client will sustain a connection to this channel until it is
kicked, disconnected from Discord, or told to disconnect.
@@ -46,6 +54,7 @@ another voice channel in the guild.
[IAudioClient]: xref:Discord.Audio.IAudioClient
[ConnectAsync]: xref:Discord.IAudioChannel.ConnectAsync*
[RunMode.Async]: xref:Discord.Commands.RunMode
## Transmitting Audio