inrole now shows the number of users in a given role

This commit is contained in:
Kwoth 2017-03-06 04:20:06 +01:00
parent 504da01917
commit f1157f424b

View File

@ -225,8 +225,9 @@ namespace NadekoBot.Modules.Utility
var usrs = (await Context.Guild.GetUsersAsync()).ToArray();
foreach (var role in roles.Where(r => r.Id != Context.Guild.Id))
{
send += $"```css\n[{role.Name}]\n";
send += string.Join(", ", usrs.Where(u => u.RoleIds.Contains(role.Id)).Select(u => u.ToString()));
var roleUsers = usrs.Where(u => u.RoleIds.Contains(role.Id)).Select(u => u.ToString()).ToArray();
send += $"```css\n[{role.Name}] ({roleUsers.Length})\n";
send += string.Join(", ", roleUsers);
send += "\n```";
}
var usr = (IGuildUser)Context.User;