mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
error out if no members to operate on were provided when -all is not passed in group member add/remove
This commit is contained in:
parent
c68a77bb32
commit
c730820614
1 changed files with 4 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ public class GroupMember
|
||||||
target.Color, opts, all);
|
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)
|
||||||
{
|
{
|
||||||
ctx.CheckOwnGroup(target);
|
ctx.CheckOwnGroup(target);
|
||||||
|
|
||||||
|
|
@ -98,6 +98,9 @@ public class GroupMember
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (_members == null)
|
||||||
|
throw new PKError("Please provide a list of members to add/remove.");
|
||||||
|
|
||||||
members = _members
|
members = _members
|
||||||
.FindAll(m => m.System == ctx.System.Id)
|
.FindAll(m => m.System == ctx.System.Id)
|
||||||
.Select(m => m.Id)
|
.Select(m => m.Id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue