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:
parent
c93d7ca8d3
commit
c1b1c89047
1 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Boyfriend.Data;
|
using Boyfriend.Data;
|
||||||
using Boyfriend.Services;
|
using Boyfriend.Services;
|
||||||
|
@ -104,7 +105,7 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
{
|
{
|
||||||
communicationDisabledUntil = guildMember.CommunicationDisabledUntil.OrDefault(null);
|
communicationDisabledUntil = guildMember.CommunicationDisabledUntil.OrDefault(null);
|
||||||
|
|
||||||
AppendGuildInformation(guildMember, builder);
|
embedColor = AppendGuildInformation(embedColor, guildMember, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
var isMuted = (memberData.MutedUntil is not null && DateTimeOffset.UtcNow <= memberData.MutedUntil) ||
|
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);
|
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))
|
if (guildMember.Nickname.IsDefined(out var nickname))
|
||||||
{
|
{
|
||||||
|
@ -166,6 +167,7 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
{
|
{
|
||||||
builder.Append("- ").AppendLine(Messages.ShowInfoGuildMemberPremiumSince)
|
builder.Append("- ").AppendLine(Messages.ShowInfoGuildMemberPremiumSince)
|
||||||
.AppendLine(Markdown.Timestamp(premiumSince.Value));
|
.AppendLine(Markdown.Timestamp(premiumSince.Value));
|
||||||
|
color = ColorsList.Magenta;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildMember.Roles.Count > 0)
|
if (guildMember.Roles.Count > 0)
|
||||||
|
@ -178,6 +180,8 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
|
|
||||||
builder.AppendLine($"<@&{guildMember.Roles[^1]}>");
|
builder.AppendLine($"<@&{guildMember.Roles[^1]}>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AppendBanInformation(MemberData memberData, StringBuilder builder)
|
private static void AppendBanInformation(MemberData memberData, StringBuilder builder)
|
||||||
|
|
Loading…
Add table
Reference in a new issue