Fixed .inrole
This commit is contained in:
parent
c1accaebfd
commit
dba640c129
@ -219,12 +219,15 @@ namespace NadekoBot.Modules.Utility
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task InRole([Remainder] IRole role)
|
public async Task InRole([Remainder] IRole role)
|
||||||
{
|
{
|
||||||
|
var rng = new NadekoRandom();
|
||||||
var usrs = (await Context.Guild.GetUsersAsync()).ToArray();
|
var usrs = (await Context.Guild.GetUsersAsync()).ToArray();
|
||||||
var roleUsers = usrs.Where(u => u.RoleIds.Contains(role.Id)).Select(u => u.ToString()).ToArray();
|
var roleUsers = usrs.Where(u => u.RoleIds.Contains(role.Id)).Select(u => u.ToString())
|
||||||
|
.ToArray();
|
||||||
var embed = new EmbedBuilder().WithOkColor()
|
var embed = new EmbedBuilder().WithOkColor()
|
||||||
.WithTitle("ℹ️ " + Format.Bold(GetText("inrole_list")) + $" - {roleUsers.Length}")
|
.WithTitle("ℹ️ " + Format.Bold(GetText("inrole_list", Format.Bold(role.Name))) + $" - {roleUsers.Length}")
|
||||||
.WithDescription(string.Join(", ", roleUsers));
|
.WithDescription(string.Join(", ", roleUsers
|
||||||
|
.OrderBy(x => rng.Next())
|
||||||
|
.Take(50)));
|
||||||
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user