Skip to content

Commit

Permalink
Hidden unknown role permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha12 committed Dec 14, 2023
1 parent 55c9af1 commit 32e31b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/GrillBot.App/Actions/Commands/RolesReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ private async Task<List<EmbedFieldBuilder>> GetDetailFieldsAsync(IRole role)
}
}

var perms = role.Permissions.Administrator ? new List<string> { "Administrator" } : role.Permissions.ToList().ConvertAll(o => o.ToString());
var perms = role.Permissions.Administrator ?
new List<string> { "Administrator" } :
role.Permissions.ToList().Select(o => o.ToString()).Where(o => !ulong.TryParse(o, CultureInfo.InvariantCulture, out _)).ToList();
if (perms.Count > 0)
result.Add(CreateField("Permissions", string.Join(", ", perms), false));

Expand Down

0 comments on commit 32e31b9

Please sign in to comment.