feat: implement system name etc. commands

This commit is contained in:
dusk 2025-03-31 22:22:38 +09:00
parent 87f6fe9d75
commit ac52b5c257
No known key found for this signature in database
10 changed files with 155 additions and 103 deletions

View file

@ -39,14 +39,14 @@ public class EmbedService
return Task.WhenAll(ids.Select(Inner));
}
public async Task<Embed> CreateSystemEmbed(Context cctx, PKSystem system, LookupContext ctx)
public async Task<Embed> CreateSystemEmbed(Context cctx, PKSystem system, LookupContext ctx, bool countctxByOwner)
{
// Fetch/render info for all accounts simultaneously
var accounts = await _repo.GetSystemAccounts(system.Id);
var users = (await GetUsers(accounts)).Select(x => x.User?.NameAndMention() ?? $"(deleted account {x.Id})");
var countctx = LookupContext.ByNonOwner;
if (cctx.MatchFlag("a", "all"))
if (countctxByOwner)
{
if (system.Id == cctx.System.Id)
countctx = LookupContext.ByOwner;