Bot will no longer reconnect the channel between songs

This commit is contained in:
Master Kwoth 2017-06-10 08:19:40 +02:00
parent 29483d4909
commit 7d5afdd234

View File

@ -131,9 +131,8 @@ namespace NadekoBot.Services.Music
if (CurrentSong == null) if (CurrentSong == null)
continue; continue;
if (AudioClient != null) if (AudioClient == null || AudioClient.ConnectionState == ConnectionState.Disconnected || AudioClient.ConnectionState == ConnectionState.Disconnecting)
try { await AudioClient.StopAsync().ConfigureAwait(false); } catch { } AudioClient = await PlaybackVoiceChannel.ConnectAsync().ConfigureAwait(false);
AudioClient = await PlaybackVoiceChannel.ConnectAsync().ConfigureAwait(false);
var index = _playlist.IndexOf(CurrentSong); var index = _playlist.IndexOf(CurrentSong);
if (index != -1) if (index != -1)