feat: don't show non-hoisted roles
This commit is contained in:
parent
865bf024f3
commit
0e2ffa7e9a
1 changed files with 14 additions and 12 deletions
26
Program.cs
26
Program.cs
|
@ -253,22 +253,24 @@ namespace chord
|
|||
|
||||
foreach (var roles in client.GetGuild(currentSelectedGuild).Roles)
|
||||
{
|
||||
if (roles.Members.Count() != 0) {
|
||||
var roleName = Regex.Replace(roles.Name, @"[^\u0000-\u007F]+", string.Empty);
|
||||
var node = new TreeNode(roleName);
|
||||
if (roles.IsHoisted) {
|
||||
if (roles.Members.Count() != 0) {
|
||||
var roleName = Regex.Replace(roles.Name, @"[^\u0000-\u007F]+", string.Empty);
|
||||
var node = new TreeNode(roleName);
|
||||
|
||||
foreach (var users in roles.Members)
|
||||
{
|
||||
var userName = Regex.Replace(users.Username, @"[^\u0000-\u007F]+", string.Empty);
|
||||
foreach (var users in roles.Members)
|
||||
{
|
||||
var userName = Regex.Replace(users.Username, @"[^\u0000-\u007F]+", string.Empty);
|
||||
|
||||
string userNick = string.Empty;
|
||||
if (users.Nickname != null)
|
||||
userNick = Regex.Replace(users.Nickname, @"[^\u0000-\u007F]+", string.Empty);
|
||||
string userNick = string.Empty;
|
||||
if (users.Nickname != null)
|
||||
userNick = Regex.Replace(users.Nickname, @"[^\u0000-\u007F]+", string.Empty);
|
||||
|
||||
node.Children.Add(new TreeNode($"{userName}#{users.Discriminator} ({userNick})"));
|
||||
node.Children.Add(new TreeNode($"{userName}#{users.Discriminator} ({userNick})"));
|
||||
}
|
||||
|
||||
rolesDict.TryAdd(Math.Abs(roles.Position - client.GetGuild(currentSelectedGuild).Roles.Count()), node);
|
||||
}
|
||||
|
||||
rolesDict.TryAdd(Math.Abs(roles.Position - client.GetGuild(currentSelectedGuild).Roles.Count()), node);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue