feat(bot): add confirmation to pk;group remove -all

This commit is contained in:
Petal Ladenson 2024-11-07 19:01:37 -07:00 committed by GitHub
parent f5c457401a
commit 46bc920234
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -123,6 +123,9 @@ public class GroupMember
toAction = members
.Where(m => existingMembersInGroup.Contains(m.Value))
.ToList();
if (ctx.MatchFlag("all", "a") && !await ctx.PromptYesNo($"Are you sure you want to remove all members from group {target.Reference(ctx)}?", "Empty Group")) throw Errors.GenericCancelled();
await ctx.Repository.RemoveMembersFromGroup(target.Id, toAction);
}
else