[Feature] Allow switching voice channels without disconnecting (external clients only) (#2866)
* eh well it should work * fix issues * make sure an external client is used
This commit is contained in:
@@ -1723,14 +1723,15 @@ namespace Discord.WebSocket
|
||||
{
|
||||
return _audioClient?.GetInputStream(userId);
|
||||
}
|
||||
internal async Task<IAudioClient> ConnectAudioAsync(ulong channelId, bool selfDeaf, bool selfMute, bool external)
|
||||
internal async Task<IAudioClient> ConnectAudioAsync(ulong channelId, bool selfDeaf, bool selfMute, bool external, bool disconnect = true)
|
||||
{
|
||||
TaskCompletionSource<AudioClient> promise;
|
||||
|
||||
await _audioLock.WaitAsync().ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
await DisconnectAudioInternalAsync().ConfigureAwait(false);
|
||||
if (disconnect || !external)
|
||||
await DisconnectAudioInternalAsync().ConfigureAwait(false);
|
||||
promise = new TaskCompletionSource<AudioClient>();
|
||||
_audioConnectPromise = promise;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user