diff --git a/src/NadekoBot/Modules/Music/Music.cs b/src/NadekoBot/Modules/Music/Music.cs index c2dc3614..8ca46e0a 100644 --- a/src/NadekoBot/Modules/Music/Music.cs +++ b/src/NadekoBot/Modules/Music/Music.cs @@ -120,7 +120,7 @@ namespace NadekoBot.Modules.Music } } } - //todo test play + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] public Task Play([Remainder]string query = null) @@ -722,7 +722,7 @@ namespace NadekoBot.Modules.Music if (mp == null) return; - //todo test move + mp.SetVoiceChannel(vch); } @@ -886,7 +886,6 @@ namespace NadekoBot.Modules.Music await ReplyConfirmLocalized("autoplay_enabled").ConfigureAwait(false); } - //todo test output text channel [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [RequireUserPermission(GuildPermission.ManageMessages)] diff --git a/src/NadekoBot/Services/Music/MusicPlayer.cs b/src/NadekoBot/Services/Music/MusicPlayer.cs index 577800b6..97ef8ee7 100644 --- a/src/NadekoBot/Services/Music/MusicPlayer.cs +++ b/src/NadekoBot/Services/Music/MusicPlayer.cs @@ -63,6 +63,7 @@ namespace NadekoBot.Services.Music private bool manualSkip = false; + private bool newVoiceChannel = false; public MusicPlayer(MusicService musicService, IVoiceChannel vch, ITextChannel output, float volume) { @@ -200,7 +201,8 @@ namespace NadekoBot.Services.Music { if (_audioClient == null || _audioClient.ConnectionState != ConnectionState.Connected || - reconnect) + reconnect || + newVoiceChannel) try { try @@ -211,6 +213,7 @@ namespace NadekoBot.Services.Music catch { } + newVoiceChannel = false; _audioClient = await VoiceChannel.ConnectAsync(); } catch @@ -389,6 +392,7 @@ namespace NadekoBot.Services.Music public void SetVoiceChannel(IVoiceChannel vch) { VoiceChannel = vch; + newVoiceChannel = true; Next(); }