Merge pull request #317 from spiralw/feat/fronters-only

Add flag to remove 'no fronter' item on frontpercent card
This commit is contained in:
Astrid
2021-04-22 18:35:24 +02:00
committed by GitHub
4 changed files with 17 additions and 6 deletions

View File

@@ -499,8 +499,9 @@ namespace PluralKit.Bot
else
title.Append($"`{targetSystem.Hid}`");
var ignoreNoFronters = ctx.MatchFlag("fo", "fronters-only");
var frontpercent = await _db.Execute(c => _repo.GetFrontBreakdown(c, targetSystem.Id, target.Id, rangeStart.Value.ToInstant(), now));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, targetSystem, target, targetSystem.Zone, ctx.LookupContextFor(targetSystem), title.ToString()));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, targetSystem, target, targetSystem.Zone, ctx.LookupContextFor(targetSystem), title.ToString(), ignoreNoFronters));
}
private async Task<PKSystem> GetGroupSystem(Context ctx, PKGroup target, IPKConnection conn)

View File

@@ -131,8 +131,9 @@ namespace PluralKit.Bot
else
title.Append($"`{system.Hid}`");
var ignoreNoFronters = ctx.MatchFlag("fo", "fronters-only");
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()));
await ctx.Reply(embed: await _embeds.CreateFrontPercentEmbed(frontpercent, system, null, system.Zone, ctx.LookupContextFor(system), title.ToString(), ignoreNoFronters));
}
}
}