bot: sort member list alphabetically

This commit is contained in:
Ske 2019-04-29 19:44:17 +02:00
parent 9a5a5ce34f
commit c359935855

View File

@ -103,7 +103,7 @@ namespace PluralKit.Bot.Commands
var members = await Members.GetBySystem(system); var members = await Members.GetBySystem(system);
var embedTitle = system.Name != null ? $"Members of {system.Name} (`{system.Hid}`)" : $"Members of `{system.Hid}`"; var embedTitle = system.Name != null ? $"Members of {system.Name} (`{system.Hid}`)" : $"Members of `{system.Hid}`";
await Context.Paginate<PKMember>( await Context.Paginate<PKMember>(
members.ToList(), members.OrderBy(m => m.Name).ToList(),
25, 25,
embedTitle, embedTitle,
(eb, ms) => eb.Description = string.Join("\n", ms.Select((m) => $"[`{m.Hid}`] **{m.Name}** *({m.Prefix ?? ""}text{m.Suffix ?? ""})*")) (eb, ms) => eb.Description = string.Join("\n", ms.Select((m) => $"[`{m.Hid}`] **{m.Name}** *({m.Prefix ?? ""}text{m.Suffix ?? ""})*"))
@ -120,7 +120,7 @@ namespace PluralKit.Bot.Commands
var members = await Members.GetBySystem(system); var members = await Members.GetBySystem(system);
var embedTitle = system.Name != null ? $"Members of {system.Name} (`{system.Hid}`)" : $"Members of `{system.Hid}`"; var embedTitle = system.Name != null ? $"Members of {system.Name} (`{system.Hid}`)" : $"Members of `{system.Hid}`";
await Context.Paginate<PKMember>( await Context.Paginate<PKMember>(
members.ToList(), members.OrderBy(m => m.Name).ToList(),
10, 10,
embedTitle, embedTitle,
(eb, ms) => { (eb, ms) => {