From c764f922ecb8bcb2bccf42b5db48deb5a9df57ee Mon Sep 17 00:00:00 2001 From: Spectralitree Date: Sun, 28 Mar 2021 19:22:45 +0200 Subject: [PATCH] Add color field to embeds --- PluralKit.Bot/Services/EmbedService.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index ee246a18..2a9d5bff 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -79,7 +79,10 @@ namespace PluralKit.Bot { } if (system.Tag != null) - eb.Field(new("Tag", system.Tag.EscapeMarkdown())); + eb.Field(new("Tag", system.Tag.EscapeMarkdown(), true)); + + if (!system.Color.EmptyOrNull()) eb.Field(new("Color", $"#{system.Color}", true)); + eb.Field(new("Linked accounts", string.Join("\n", users).Truncate(1000), true)); if (system.MemberListPrivacy.CanAccess(ctx)) @@ -215,15 +218,17 @@ namespace PluralKit.Bot { .Footer(new($"System ID: {system.Hid} | Group ID: {target.Hid} | Created on {target.Created.FormatZoned(system)}")); if (target.DisplayName != null) - eb.Field(new("Display Name", target.DisplayName)); + eb.Field(new("Display Name", target.DisplayName, true)); + + if (!target.Color.EmptyOrNull()) eb.Field(new("Color", $"#{target.Color}", true)); if (target.ListPrivacy.CanAccess(pctx)) { if (memberCount == 0 && pctx == LookupContext.ByOwner) // Only suggest the add command if this is actually the owner lol - eb.Field(new("Members (0)", $"Add one with `pk;group {target.Reference()} add `!", true)); + eb.Field(new("Members (0)", $"Add one with `pk;group {target.Reference()} add `!", false)); else - eb.Field(new($"Members ({memberCount})", $"(see `pk;group {target.Reference()} list`)", true)); + eb.Field(new($"Members ({memberCount})", $"(see `pk;group {target.Reference()} list`)", false)); } if (target.DescriptionFor(pctx) is { } desc)