Music warning removed

This commit is contained in:
Kwoth 2017-01-15 18:25:53 +01:00
parent 257dbcb738
commit d65b415ee8

View File

@ -37,17 +37,17 @@ namespace NadekoBot.Modules.Music
Directory.CreateDirectory(MusicDataPath); Directory.CreateDirectory(MusicDataPath);
} }
private static async Task Client_UserVoiceStateUpdated(SocketUser iusr, SocketVoiceState oldState, SocketVoiceState newState) private static Task Client_UserVoiceStateUpdated(SocketUser iusr, SocketVoiceState oldState, SocketVoiceState newState)
{ {
var usr = iusr as SocketGuildUser; var usr = iusr as SocketGuildUser;
if (usr == null || if (usr == null ||
oldState.VoiceChannel == newState.VoiceChannel) oldState.VoiceChannel == newState.VoiceChannel)
return; return Task.CompletedTask;
MusicPlayer player; MusicPlayer player;
if (!MusicPlayers.TryGetValue(usr.Guild.Id, out player)) if (!MusicPlayers.TryGetValue(usr.Guild.Id, out player))
return; return Task.CompletedTask;
try try
{ {
@ -61,7 +61,7 @@ namespace NadekoBot.Modules.Music
else if (!player.Paused && newState.VoiceChannel.Users.Count <= 1) // pause if there are no users in the new channel else if (!player.Paused && newState.VoiceChannel.Users.Count <= 1) // pause if there are no users in the new channel
player.TogglePause(); player.TogglePause();
return; return Task.CompletedTask;
} }
@ -74,11 +74,12 @@ namespace NadekoBot.Modules.Music
oldState.VoiceChannel.Users.Count == 1)) oldState.VoiceChannel.Users.Count == 1))
{ {
player.TogglePause(); player.TogglePause();
return; return Task.CompletedTask;
} }
} }
catch { } catch { }
return Task.CompletedTask;
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]