Add group front percentages (fixing Git history)

Signed-off-by: Ske <voltasalt@gmail.com>
This commit is contained in:
Spectralitree
2021-02-09 23:36:43 +01:00
committed by Ske
parent 5615aa6c00
commit 7010becd32
6 changed files with 53 additions and 9 deletions

View File

@@ -125,8 +125,14 @@ namespace PluralKit.Bot
if (rangeStart == null) throw Errors.InvalidDateTime(durationStr);
if (rangeStart.Value.ToInstant() > now) throw Errors.FrontPercentTimeInFuture;
var frontpercent = await _db.Execute(c => _repo.GetFrontBreakdown(c, system.Id, rangeStart.Value.ToInstant(), now));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, system.Zone, ctx.LookupContextFor(system)));
var title = new StringBuilder($"Frontpercent of ");
if (system.Name != null)
title.Append($"{system.Name} (`{system.Hid}`)");
else
title.Append($"`{system.Hid}`");
var frontpercent = await _db.Execute(c => _repo.GetFrontBreakdown(c, system.Id, null, rangeStart.Value.ToInstant(), now));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, system, null, system.Zone, ctx.LookupContextFor(system), title.ToString()));
}
}
}