.whpl fixed

This commit is contained in:
Kwoth 2016-12-22 06:15:59 +01:00
parent 22c8278673
commit 7de4ade5e5

View File

@ -35,16 +35,16 @@ namespace NadekoBot.Modules.Utility
game = game.Trim().ToUpperInvariant();
if (string.IsNullOrWhiteSpace(game))
return;
var arr = (await (umsg.Channel as IGuildChannel).Guild.GetUsersAsync())
var usrs = (await (umsg.Channel as IGuildChannel).Guild.GetUsersAsync())
.Where(u => u.Game?.Name?.ToUpperInvariant() == game)
.Select(u => u.Username)
.ToList();
int i = 0;
if (!arr.Any())
if (!usrs.Any())
await channel.SendErrorAsync("Nobody is playing that game.").ConfigureAwait(false);
else
await channel.SendConfirmAsync("```css\n" + string.Join("\n", arr.GroupBy(item => (i++) / 2)
await channel.SendConfirmAsync($"List of users playing {game} game. Total {usrs.Count}.", "```css\n" + string.Join("\n", usrs.Take(30).GroupBy(item => (i++) / 2)
.Select(ig => string.Concat(ig.Select(el => $"• {el,-27}")))) + "\n```")
.ConfigureAwait(false);
}