mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 00:07:55 +00:00
feat: implement system name etc. commands
This commit is contained in:
parent
87f6fe9d75
commit
ac52b5c257
10 changed files with 155 additions and 103 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue