fix: crashing with unicode in user nick
This commit is contained in:
parent
600fa261b5
commit
70bbade763
1 changed files with 4 additions and 1 deletions
|
@ -258,7 +258,10 @@ namespace chord
|
|||
|
||||
foreach (var users in roles.Members)
|
||||
{
|
||||
node.Children.Add(new TreeNode($"{users.Username}#{users.Discriminator} ({users.Nickname})"));
|
||||
var userName = Regex.Replace(users.Username, @"[^\u0000-\u007F]+", string.Empty);
|
||||
var userNick = Regex.Replace(users.Nickname, @"[^\u0000-\u007F]+", string.Empty);
|
||||
|
||||
node.Children.Add(new TreeNode($"{userNick}#{users.Discriminator} ({userNick})"));
|
||||
}
|
||||
|
||||
rolesDict.Add(roles.Position, node);
|
||||
|
|
Reference in a new issue