mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 22:37:54 +00:00
Add group front percentages (fixing Git history)
Signed-off-by: Ske <voltasalt@gmail.com>
This commit is contained in:
parent
5615aa6c00
commit
7010becd32
6 changed files with 53 additions and 9 deletions
|
|
@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue