diff --git a/src/Lavalink4NET.DiscordNet/DiscordClientWrapper.cs b/src/Lavalink4NET.DiscordNet/DiscordClientWrapper.cs index 24ca8259..ad77940b 100644 --- a/src/Lavalink4NET.DiscordNet/DiscordClientWrapper.cs +++ b/src/Lavalink4NET.DiscordNet/DiscordClientWrapper.cs @@ -189,12 +189,12 @@ public async ValueTask SendVoiceUpdateAsync(ulong guildId, ulong? voiceChannelId cancellationToken.ThrowIfCancellationRequested(); var guild = _baseSocketClient.GetGuild(guildId) - ?? throw new ArgumentException("Invalid or inaccessible guild: " + guildId, nameof(guildId)); + ?? throw new ArgumentException($"Invalid or inaccessible guild: {guildId}", nameof(guildId)); if (voiceChannelId.HasValue) { var channel = guild.GetVoiceChannel(voiceChannelId.Value) - ?? throw new ArgumentException("Invalid or inaccessible voice channel: " + voiceChannelId, nameof(voiceChannelId)); + ?? throw new ArgumentException($"Invalid or inaccessible voice channel: {voiceChannelId}", nameof(voiceChannelId)); await channel .ConnectAsync(selfDeaf, selfMute, external: true) @@ -205,9 +205,10 @@ await channel } // Disconnect from voice channel + // Note: Internally it does not matter which voice channel to disconnect from await guild - .AudioClient - .StopAsync() + .VoiceChannels.First() + .DisconnectAsync() .WaitAsync(cancellationToken) .ConfigureAwait(false); }