| @@ -27,5 +27,13 @@ namespace Discord | |||||
| /// A task representing the asynchronous operation for disconnecting from the audio channel. | /// A task representing the asynchronous operation for disconnecting from the audio channel. | ||||
| /// </returns> | /// </returns> | ||||
| Task DisconnectAsync(); | Task DisconnectAsync(); | ||||
| /// <summary> | |||||
| /// Sends voice state update of this audio channel. | |||||
| /// </summary> | |||||
| /// <param name="selfDeaf">Determines whether the client should deaf itself.</param> | |||||
| /// <param name="selfMute">Determines whether the client should mute itself.</param> | |||||
| /// <returns></returns> | |||||
| Task SendVoiceStateUpdateAsync(bool selfDeaf, bool selfMute); | |||||
| } | } | ||||
| } | } | ||||
| @@ -196,6 +196,7 @@ namespace Discord.Rest | |||||
| /// <exception cref="NotSupportedException">Connecting to a group channel is not supported.</exception> | /// <exception cref="NotSupportedException">Connecting to a group channel is not supported.</exception> | ||||
| Task<IAudioClient> IAudioChannel.ConnectAsync(bool selfDeaf, bool selfMute, bool external) { throw new NotSupportedException(); } | Task<IAudioClient> IAudioChannel.ConnectAsync(bool selfDeaf, bool selfMute, bool external) { throw new NotSupportedException(); } | ||||
| Task IAudioChannel.DisconnectAsync() { throw new NotSupportedException(); } | Task IAudioChannel.DisconnectAsync() { throw new NotSupportedException(); } | ||||
| Task IAudioChannel.SendVoiceStateUpdateAsync(bool selfDeaf, bool selfMute) { throw new NotSupportedException(); } | |||||
| //IChannel | //IChannel | ||||
| Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) | ||||
| @@ -76,6 +76,7 @@ namespace Discord.Rest | |||||
| /// <exception cref="NotSupportedException">Connecting to a REST-based channel is not supported.</exception> | /// <exception cref="NotSupportedException">Connecting to a REST-based channel is not supported.</exception> | ||||
| Task<IAudioClient> IAudioChannel.ConnectAsync(bool selfDeaf, bool selfMute, bool external) { throw new NotSupportedException(); } | Task<IAudioClient> IAudioChannel.ConnectAsync(bool selfDeaf, bool selfMute, bool external) { throw new NotSupportedException(); } | ||||
| Task IAudioChannel.DisconnectAsync() { throw new NotSupportedException(); } | Task IAudioChannel.DisconnectAsync() { throw new NotSupportedException(); } | ||||
| Task IAudioChannel.SendVoiceStateUpdateAsync(bool selfDeaf, bool selfMute) { throw new NotSupportedException(); } | |||||
| //IGuildChannel | //IGuildChannel | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| @@ -311,6 +311,7 @@ namespace Discord.WebSocket | |||||
| /// <exception cref="NotSupportedException">Connecting to a group channel is not supported.</exception> | /// <exception cref="NotSupportedException">Connecting to a group channel is not supported.</exception> | ||||
| Task<IAudioClient> IAudioChannel.ConnectAsync(bool selfDeaf, bool selfMute, bool external) { throw new NotSupportedException(); } | Task<IAudioClient> IAudioChannel.ConnectAsync(bool selfDeaf, bool selfMute, bool external) { throw new NotSupportedException(); } | ||||
| Task IAudioChannel.DisconnectAsync() { throw new NotSupportedException(); } | Task IAudioChannel.DisconnectAsync() { throw new NotSupportedException(); } | ||||
| Task IAudioChannel.SendVoiceStateUpdateAsync(bool selfDeaf, bool selfMute) { throw new NotSupportedException(); } | |||||
| //IChannel | //IChannel | ||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| @@ -76,6 +76,11 @@ namespace Discord.WebSocket | |||||
| public async Task DisconnectAsync() | public async Task DisconnectAsync() | ||||
| => await Guild.DisconnectAudioAsync(); | => await Guild.DisconnectAudioAsync(); | ||||
| public async Task SendVoiceStateUpdateAsync(bool selfDeaf, bool selfMute) | |||||
| { | |||||
| await Guild.SendVoiceStateUpdateAsync(Id, selfDeaf, selfMute); | |||||
| } | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public override SocketGuildUser GetUser(ulong id) | public override SocketGuildUser GetUser(ulong id) | ||||
| { | { | ||||
| @@ -1131,6 +1131,12 @@ namespace Discord.WebSocket | |||||
| _audioLock.Release(); | _audioLock.Release(); | ||||
| } | } | ||||
| } | } | ||||
| internal async Task SendVoiceStateUpdateAsync(ulong channelId, bool selfDeaf, bool selfMute) | |||||
| { | |||||
| await Discord.ApiClient.SendVoiceStateUpdateAsync(Id, channelId, selfDeaf, selfMute).ConfigureAwait(false); | |||||
| } | |||||
| private async Task DisconnectAudioInternalAsync() | private async Task DisconnectAudioInternalAsync() | ||||
| { | { | ||||
| _audioConnectPromise?.TrySetCanceledAsync(); //Cancel any previous audio connection | _audioConnectPromise?.TrySetCanceledAsync(); //Cancel any previous audio connection | ||||
| @@ -41,6 +41,11 @@ namespace Discord | |||||
| throw new NotImplementedException(); | throw new NotImplementedException(); | ||||
| } | } | ||||
| public Task SendVoiceStateUpdateAsync(bool selfDeaf, bool selfMute) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public IDisposable EnterTypingState(RequestOptions options = null) | public IDisposable EnterTypingState(RequestOptions options = null) | ||||
| { | { | ||||
| throw new NotImplementedException(); | throw new NotImplementedException(); | ||||
| @@ -58,6 +58,11 @@ namespace Discord | |||||
| throw new NotImplementedException(); | throw new NotImplementedException(); | ||||
| } | } | ||||
| public Task SendVoiceStateUpdateAsync(bool selfDeaf, bool selfMute) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public Task<ICategoryChannel> GetCategoryAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null) | public Task<ICategoryChannel> GetCategoryAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null) | ||||
| { | { | ||||
| throw new NotImplementedException(); | throw new NotImplementedException(); | ||||