Add group front percentages

Also add a title to the system frontpercent embed, and tweak the footer
This commit is contained in:
Spectralitree
2021-02-09 23:36:43 +01:00
parent 74424edc89
commit 9d80b7b141
6 changed files with 54 additions and 10 deletions

View File

@@ -293,12 +293,13 @@ namespace PluralKit.Bot {
return eb.Build();
}
public Task<Embed> CreateFrontPercentEmbed(FrontBreakdown breakdown, DateTimeZone tz, LookupContext ctx)
public Task<Embed> CreateFrontPercentEmbed(FrontBreakdown breakdown, PKSystem system, PKGroup group, DateTimeZone tz, LookupContext ctx, string embedTitle)
{
var actualPeriod = breakdown.RangeEnd - breakdown.RangeStart;
var eb = new EmbedBuilder()
.Title(embedTitle)
.Color(DiscordUtils.Gray)
.Footer(new($"Since {breakdown.RangeStart.FormatZoned(tz)} ({actualPeriod.FormatDuration()} ago)"));
.Footer(new($"System ID: {system.Hid} | {(group != null ? $"Group ID: {group.Hid} | " : "") }Since {breakdown.RangeStart.FormatZoned(tz)} ({actualPeriod.FormatDuration()} ago)"));
var maxEntriesToDisplay = 24; // max 25 fields allowed in embed - reserve 1 for "others"