Truncate roles list if it gets too long

This commit is contained in:
Ske 2020-09-12 19:30:03 +02:00
parent d875472c9f
commit 7b59040da2

View File

@ -203,7 +203,10 @@ namespace PluralKit.Bot {
var roles = memberInfo?.Roles?.ToList(); var roles = memberInfo?.Roles?.ToList();
if (roles != null && roles.Count > 0) if (roles != null && roles.Count > 0)
eb.AddField($"Account roles ({roles.Count})", string.Join(", ", roles.Select(role => role.Name))); {
var rolesString = string.Join(", ", roles.Select(role => role.Name));
eb.AddField($"Account roles ({roles.Count})", rolesString.Truncate(1024));
}
return eb.Build(); return eb.Build();
} }