From c730820614bc53a493697ffd3456e66212a46fbd Mon Sep 17 00:00:00 2001 From: dusk Date: Sun, 23 Nov 2025 20:19:23 +0000 Subject: [PATCH] error out if no members to operate on were provided when -all is not passed in group member add/remove --- PluralKit.Bot/Commands/GroupMember.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Commands/GroupMember.cs b/PluralKit.Bot/Commands/GroupMember.cs index a53bdd37..43ccbba9 100644 --- a/PluralKit.Bot/Commands/GroupMember.cs +++ b/PluralKit.Bot/Commands/GroupMember.cs @@ -83,7 +83,7 @@ public class GroupMember target.Color, opts, all); } - public async Task AddRemoveMembers(Context ctx, PKGroup target, List _members, Groups.AddRemoveOperation op, bool all, bool confirmYes) + public async Task AddRemoveMembers(Context ctx, PKGroup target, List? _members, Groups.AddRemoveOperation op, bool all, bool confirmYes) { ctx.CheckOwnGroup(target); @@ -98,6 +98,9 @@ public class GroupMember } else { + if (_members == null) + throw new PKError("Please provide a list of members to add/remove."); + members = _members .FindAll(m => m.System == ctx.System.Id) .Select(m => m.Id)