.whpl fix on many users

This commit is contained in:
Kwoth 2017-01-26 08:02:57 +01:00
parent 15a3b99cbd
commit 5d5a67b477

View File

@ -116,16 +116,19 @@ namespace NadekoBot.Modules.Utility
var arr = (await (Context.Channel as IGuildChannel).Guild.GetUsersAsync()) var arr = (await (Context.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)
.Shuffle()
.Take(60)
.ToList(); .ToList();
int i = 0; int i = 0;
if (!arr.Any()) if (!arr.Any())
await Context.Channel.SendErrorAsync("Nobody is playing that game.").ConfigureAwait(false); await Context.Channel.SendErrorAsync("Nobody is playing that game.").ConfigureAwait(false);
else else {
await Context.Channel.SendConfirmAsync("```css\n" + string.Join("\n", arr.GroupBy(item => (i++) / 2) await Context.Channel.SendConfirmAsync("```css\n" + string.Join("\n", arr.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);
} }
}
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]