mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 08:40:11 +00:00
add missing -yes flags to command definitions, use log crate instead of printlns in command parser, also accept double dash for flags
This commit is contained in:
parent
8431255930
commit
12655fb539
16 changed files with 130 additions and 53 deletions
|
|
@ -83,7 +83,7 @@ public class GroupMember
|
|||
target.Color, opts, all);
|
||||
}
|
||||
|
||||
public async Task AddRemoveMembers(Context ctx, PKGroup target, List<PKMember>? _members, Groups.AddRemoveOperation op, bool all, bool confirmYes)
|
||||
public async Task AddRemoveMembers(Context ctx, PKGroup target, List<PKMember>? _members, Groups.AddRemoveOperation op, bool all, bool confirmYes = false)
|
||||
{
|
||||
ctx.CheckOwnGroup(target);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace PluralKit.Bot;
|
|||
|
||||
public class SystemLink
|
||||
{
|
||||
public async Task LinkSystem(Context ctx, User account)
|
||||
public async Task LinkSystem(Context ctx, User account, bool confirmYes = false)
|
||||
{
|
||||
ctx.CheckSystem();
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ public class SystemLink
|
|||
throw Errors.AccountInOtherSystem(existingAccount, ctx.Config, ctx.DefaultPrefix);
|
||||
|
||||
var msg = $"{account.Mention()}, please confirm the link.";
|
||||
if (!await ctx.PromptYesNo(msg, "Confirm", account, false)) throw Errors.MemberLinkCancelled;
|
||||
if (!await ctx.PromptYesNo(msg, "Confirm", account, true, confirmYes)) throw Errors.MemberLinkCancelled;
|
||||
await ctx.Repository.AddAccount(ctx.System.Id, account.Id);
|
||||
await ctx.Reply($"{Emojis.Success} Account linked to system.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue