From c1b1c89047782c727b63a030c41b08e103badd14 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Thu, 28 Sep 2023 23:46:53 +0500 Subject: [PATCH] Change embed color if the member is a Nitro booster Signed-off-by: Octol1ttle --- src/Commands/ToolsCommandGroup.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Commands/ToolsCommandGroup.cs b/src/Commands/ToolsCommandGroup.cs index b0f3169..b283b05 100644 --- a/src/Commands/ToolsCommandGroup.cs +++ b/src/Commands/ToolsCommandGroup.cs @@ -1,4 +1,5 @@ using System.ComponentModel; +using System.Drawing; using System.Text; using Boyfriend.Data; using Boyfriend.Services; @@ -104,7 +105,7 @@ public class ToolsCommandGroup : CommandGroup { communicationDisabledUntil = guildMember.CommunicationDisabledUntil.OrDefault(null); - AppendGuildInformation(guildMember, builder); + embedColor = AppendGuildInformation(embedColor, guildMember, builder); } var isMuted = (memberData.MutedUntil is not null && DateTimeOffset.UtcNow <= memberData.MutedUntil) || @@ -151,7 +152,7 @@ public class ToolsCommandGroup : CommandGroup return await _feedback.SendContextualEmbedResultAsync(embed, ct); } - private static void AppendGuildInformation(IGuildMember guildMember, StringBuilder builder) + private static Color AppendGuildInformation(Color color, IGuildMember guildMember, StringBuilder builder) { if (guildMember.Nickname.IsDefined(out var nickname)) { @@ -166,6 +167,7 @@ public class ToolsCommandGroup : CommandGroup { builder.Append("- ").AppendLine(Messages.ShowInfoGuildMemberPremiumSince) .AppendLine(Markdown.Timestamp(premiumSince.Value)); + color = ColorsList.Magenta; } if (guildMember.Roles.Count > 0) @@ -178,6 +180,8 @@ public class ToolsCommandGroup : CommandGroup builder.AppendLine($"<@&{guildMember.Roles[^1]}>"); } + + return color; } private static void AppendBanInformation(MemberData memberData, StringBuilder builder)