remove rest of the parsing in csharp bot

This commit is contained in:
dusk 2025-10-08 03:26:40 +00:00
parent 15ffd16c01
commit 479e0a59b5
No known key found for this signature in database
35 changed files with 242 additions and 409 deletions

View file

@ -51,7 +51,7 @@ public class GroupMember
groups.Count - toAction.Count));
}
public async Task ListMemberGroups(Context ctx, PKMember target, string? query, IHasListOptions flags)
public async Task ListMemberGroups(Context ctx, PKMember target, string? query, IHasListOptions flags, bool all)
{
var targetSystem = await ctx.Repository.GetSystem(target.System);
var opts = flags.GetListOptions(ctx, target.System);
@ -80,10 +80,10 @@ public class GroupMember
title.Append($" matching **{opts.Search.Truncate(100)}**");
await ctx.RenderGroupList(ctx.LookupContextFor(target.System), target.System, title.ToString(),
target.Color, opts);
target.Color, opts, all);
}
public async Task AddRemoveMembers(Context ctx, PKGroup target, List<PKMember> _members, Groups.AddRemoveOperation op, bool all)
public async Task AddRemoveMembers(Context ctx, PKGroup target, List<PKMember> _members, Groups.AddRemoveOperation op, bool all, bool confirmYes)
{
ctx.CheckOwnGroup(target);
@ -126,7 +126,7 @@ public class GroupMember
.Where(m => existingMembersInGroup.Contains(m.Value))
.ToList();
if (all && !await ctx.PromptYesNo($"Are you sure you want to remove all members from group {target.Reference(ctx)}?", "Empty Group")) throw Errors.GenericCancelled();
if (all && !await ctx.PromptYesNo($"Are you sure you want to remove all members from group {target.Reference(ctx)}?", "Empty Group", flagValue: confirmYes)) throw Errors.GenericCancelled();
await ctx.Repository.RemoveMembersFromGroup(target.Id, toAction);
}