.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(); game = game.Trim().ToUpperInvariant();
if (string.IsNullOrWhiteSpace(game)) if (string.IsNullOrWhiteSpace(game))
return; 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) .Where(u => u.Game?.Name?.ToUpperInvariant() == game)
.Select(u => u.Username) .Select(u => u.Username)
.ToList(); .ToList();
int i = 0; int i = 0;
if (!arr.Any()) if (!usrs.Any())
await channel.SendErrorAsync("Nobody is playing that game.").ConfigureAwait(false); await channel.SendErrorAsync("Nobody is playing that game.").ConfigureAwait(false);
else 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```") .Select(ig => string.Concat(ig.Select(el => $"• {el,-27}")))) + "\n```")
.ConfigureAwait(false); .ConfigureAwait(false);
} }