Fixed random disconnects and reconnects
This commit is contained in:
parent
e648ff7d48
commit
8eb2b980d1
@ -130,15 +130,15 @@ namespace NadekoBot.Modules.Music.Classes
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (audioClient != null)
|
|
||||||
try { await audioClient.DisconnectAsync().ConfigureAwait(false); } catch { }
|
|
||||||
audioClient = await PlaybackVoiceChannel.ConnectAsync().ConfigureAwait(false);
|
|
||||||
|
|
||||||
CurrentSong = GetNextSong();
|
CurrentSong = GetNextSong();
|
||||||
|
|
||||||
if (CurrentSong == null)
|
if (CurrentSong == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (audioClient != null)
|
||||||
|
try { await audioClient.DisconnectAsync().ConfigureAwait(false); } catch { }
|
||||||
|
audioClient = await PlaybackVoiceChannel.ConnectAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
var index = playlist.IndexOf(CurrentSong);
|
var index = playlist.IndexOf(CurrentSong);
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
RemoveSongAt(index, true);
|
RemoveSongAt(index, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user