run dotnet format
This commit is contained in:
@@ -18,13 +18,13 @@ namespace PluralKit.Bot
|
||||
_db = db;
|
||||
_repo = repo;
|
||||
}
|
||||
|
||||
|
||||
public async Task LinkSystem(Context ctx)
|
||||
{
|
||||
ctx.CheckSystem();
|
||||
|
||||
await using var conn = await _db.Obtain();
|
||||
|
||||
|
||||
var account = await ctx.MatchUser() ?? throw new PKSyntaxError("You must pass an account to link with (either ID or @mention).");
|
||||
var accountIds = await _repo.GetSystemAccounts(conn, ctx.System.Id);
|
||||
if (accountIds.Contains(account.Id))
|
||||
@@ -32,7 +32,7 @@ namespace PluralKit.Bot
|
||||
|
||||
var existingAccount = await _repo.GetSystemByAccount(conn, account.Id);
|
||||
if (existingAccount != null)
|
||||
throw Errors.AccountInOtherSystem(existingAccount);
|
||||
throw Errors.AccountInOtherSystem(existingAccount);
|
||||
|
||||
var msg = $"{account.Mention()}, please confirm the link.";
|
||||
if (!await ctx.PromptYesNo(msg, "Confirm", user: account, matchFlag: false)) throw Errors.MemberLinkCancelled;
|
||||
@@ -43,7 +43,7 @@ namespace PluralKit.Bot
|
||||
public async Task UnlinkAccount(Context ctx)
|
||||
{
|
||||
ctx.CheckSystem();
|
||||
|
||||
|
||||
await using var conn = await _db.Obtain();
|
||||
|
||||
ulong id;
|
||||
@@ -55,7 +55,7 @@ namespace PluralKit.Bot
|
||||
var accountIds = (await _repo.GetSystemAccounts(conn, ctx.System.Id)).ToList();
|
||||
if (!accountIds.Contains(id)) throw Errors.AccountNotLinked;
|
||||
if (accountIds.Count == 1) throw Errors.UnlinkingLastAccount;
|
||||
|
||||
|
||||
var msg = $"Are you sure you want to unlink <@{id}> from your system?";
|
||||
if (!await ctx.PromptYesNo(msg, "Unlink")) throw Errors.MemberUnlinkCancelled;
|
||||
|
||||
|
Reference in New Issue
Block a user