From 7b59040da2cfbcb46dcbf8178561314e74e46af3 Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 12 Sep 2020 19:30:03 +0200 Subject: [PATCH] Truncate roles list if it gets too long --- PluralKit.Bot/Services/EmbedService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index 4da92f26..e0896e75 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -203,7 +203,10 @@ namespace PluralKit.Bot { var roles = memberInfo?.Roles?.ToList(); 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(); }