Allow external VoiceChannel client API implementation (#1057)

* ConnectAsync(bool external) API implemented

This allows developers to handle the AudioClient externally (for example with Lavalink)

* Modify ConnectAsync API and add DisconnectAsync to IAudioChannel

* Update summary message on IAudioChannel.DisconnectAsync()

* Review changes:
- Fix `if (!external)` styling
- Remove unecessary ConnectAsync overload

* SocketVoiceChannel overload update

* Update IAudioChannel.ConnectAsync()
- Remove ConfigAction from parameters
- Add SelfDeafen/SelfMute to parameters

* Remove SocketVoiceChannel.ConnectAsync() default params (Inherit)
This commit is contained in:
NovusTheory
2018-05-31 16:21:57 -05:00
committed by Finite Reality
parent 3acf2a9a6b
commit 890904f32c
6 changed files with 32 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
using Discord.Audio;
using Discord.Audio;
using System;
using System.Threading.Tasks;
@@ -7,6 +7,9 @@ namespace Discord
public interface IAudioChannel : IChannel
{
/// <summary> Connects to this audio channel. </summary>
Task<IAudioClient> ConnectAsync(Action<IAudioClient> configAction = null);
Task<IAudioClient> ConnectAsync(bool selfDeaf = false, bool selfMute = false, bool external = false);
/// <summary> Disconnects from this audio channel. </summary>
Task DisconnectAsync();
}
}