Handle proxy tag length overflow in short member list

This commit is contained in:
Ske 2020-01-31 11:43:53 +01:00
parent 5caf040bbc
commit a5f0d7ac13

View File

@ -177,8 +177,14 @@ namespace PluralKit.Bot.Commands
eb.Description = string.Join("\n", ms.Select((m) =>
{
if (m.HasProxyTags)
return
$"[`{m.Hid}`] **{m.Name.SanitizeMentions()}** *({m.ProxyTagsString().SanitizeMentions()})*";
{
var proxyTagsString = m.ProxyTagsString().SanitizeMentions();
if (proxyTagsString.Length > 100) // arbitrary threshold for now, tweak?
proxyTagsString = "tags too long, see member card";
return $"[`{m.Hid}`] **{m.Name.SanitizeMentions()}** *({proxyTagsString})*";
}
return $"[`{m.Hid}`] **{m.Name.SanitizeMentions()}**";
}));