1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00

Change embed color if the member is a Nitro booster

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-09-28 23:46:53 +05:00
parent c93d7ca8d3
commit c1b1c89047
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF

View file

@ -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)