diff --git a/NadekoBot/Modules/Administration/AdministrationModule.cs b/NadekoBot/Modules/Administration/AdministrationModule.cs index b7991ab3..412eb8d8 100644 --- a/NadekoBot/Modules/Administration/AdministrationModule.cs +++ b/NadekoBot/Modules/Administration/AdministrationModule.cs @@ -946,6 +946,25 @@ namespace NadekoBot.Modules.Administration await e.Channel.SendMessage(":ok:"); }); + cgb.CreateCommand(Prefix + "whoplays") + .Description("Shows a list of users who are playing the specified game") + .Parameter("game") + .Do(async e => + { + var game = e.GetArg("game").Trim().ToUpperInvariant(); + var en = e.Server.Users + .Where(u => u.CurrentGame?.ToUpperInvariant() == game) + .Select(u => $"{u.Name}"); + + var arr = en as string[] ?? en.ToArray(); + + if (arr.Length == 0) + await e.Channel.SendMessage("Nobody. (not 100% sure)"); + else + await e.Channel.SendMessage("• " + string.Join("\n• ", arr)); + + }); + }); } diff --git a/NadekoBot/Modules/Music/Classes/MusicControls.cs b/NadekoBot/Modules/Music/Classes/MusicControls.cs index 4833dda8..6180706a 100644 --- a/NadekoBot/Modules/Music/Classes/MusicControls.cs +++ b/NadekoBot/Modules/Music/Classes/MusicControls.cs @@ -95,10 +95,12 @@ namespace NadekoBot.Modules.Music.Classes Console.WriteLine($"Exception in PlaySong: {ex}"); } OnCompleted(this, curSong); - if (RepeatSong) - playlist.Insert(0, curSong); - else if (RepeatPlaylist) - playlist.Insert(playlist.Count, curSong); + curSong = CurrentSong; //to check if its null now + if (curSong != null) + if (RepeatSong) + playlist.Insert(0, curSong); + else if (RepeatPlaylist) + playlist.Insert(playlist.Count, curSong); SongCancelSource = new CancellationTokenSource(); cancelToken = SongCancelSource.Token; }