Add color to all lists

This commit is contained in:
Spectralitree
2021-03-28 19:22:31 +02:00
parent 8da5c94b1c
commit 2898b3989a
6 changed files with 10 additions and 6 deletions

View File

@@ -78,7 +78,7 @@ namespace PluralKit.Bot
return p;
}
public static async Task RenderMemberList(this Context ctx, LookupContext lookupCtx, IDatabase db, SystemId system, string embedTitle, MemberListOptions opts)
public static async Task RenderMemberList(this Context ctx, LookupContext lookupCtx, IDatabase db, SystemId system, string embedTitle, string color, MemberListOptions opts)
{
// We take an IDatabase instead of a IPKConnection so we don't keep the handle open for the entire runtime
// We wanna release it as soon as the member list is actually *fetched*, instead of potentially minutes later (paginate timeout)
@@ -87,7 +87,7 @@ namespace PluralKit.Bot
.ToList();
var itemsPerPage = opts.Type == ListType.Short ? 25 : 5;
await ctx.Paginate(members.ToAsyncEnumerable(), members.Count, itemsPerPage, embedTitle, Renderer);
await ctx.Paginate(members.ToAsyncEnumerable(), members.Count, itemsPerPage, embedTitle, color, Renderer);
// Base renderer, dispatches based on type
Task Renderer(EmbedBuilder eb, IEnumerable<ListedMember> page)