mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 00:30:11 +00:00
implement the rest of the config commands
This commit is contained in:
parent
a268f75d32
commit
0f26a69f1b
11 changed files with 480 additions and 296 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Myriad.Extensions;
|
||||
using Myriad.Types;
|
||||
|
||||
using PluralKit.Core;
|
||||
|
||||
|
|
@ -6,12 +7,10 @@ namespace PluralKit.Bot;
|
|||
|
||||
public class SystemLink
|
||||
{
|
||||
public async Task LinkSystem(Context ctx)
|
||||
public async Task LinkSystem(Context ctx, User account)
|
||||
{
|
||||
ctx.CheckSystem();
|
||||
|
||||
var account = await ctx.MatchUser() ??
|
||||
throw new PKSyntaxError("You must pass an account to link with (either ID or @mention).");
|
||||
var accountIds = await ctx.Repository.GetSystemAccounts(ctx.System.Id);
|
||||
if (accountIds.Contains(account.Id))
|
||||
throw Errors.AccountAlreadyLinked;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue