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

@ -14,18 +14,17 @@ public class System
_embeds = embeds;
}
public async Task Query(Context ctx, PKSystem system)
public async Task Query(Context ctx, PKSystem system, bool all, bool @public, bool @private)
{
if (system == null) throw Errors.NoSystemError(ctx.DefaultPrefix);
await ctx.Reply(embed: await _embeds.CreateSystemEmbed(ctx, system, ctx.LookupContextFor(system.Id)));
await ctx.Reply(embed: await _embeds.CreateSystemEmbed(ctx, system, ctx.LookupContextFor(system.Id, @private, @public), all));
}
public async Task New(Context ctx)
public async Task New(Context ctx, string? systemName)
{
ctx.CheckNoSystem();
var systemName = ctx.RemainderOrNull();
if (systemName != null && systemName.Length > Limits.MaxSystemNameLength)
throw Errors.StringTooLongError("System name", systemName.Length, Limits.MaxSystemNameLength);