mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-17 03:00:13 +00:00
feat: let you use -all flag to add or remove all members to/from a group
This commit is contained in:
parent
601d266063
commit
8dc1a3c73e
1 changed files with 13 additions and 1 deletions
|
|
@ -84,10 +84,22 @@ public class GroupMember
|
||||||
{
|
{
|
||||||
ctx.CheckOwnGroup(target);
|
ctx.CheckOwnGroup(target);
|
||||||
|
|
||||||
var members = (await ctx.ParseMemberList(ctx.System.Id))
|
List<MemberId> members;
|
||||||
|
if (ctx.MatchFlag("all", "a"))
|
||||||
|
{
|
||||||
|
members = (await ctx.Database.Execute(conn => conn.QueryMemberList(target.System,
|
||||||
|
new DatabaseViewsExt.ListQueryOptions { })))
|
||||||
|
.Select(m => m.Id)
|
||||||
|
.Distinct()
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
members = (await ctx.ParseMemberList(ctx.System.Id))
|
||||||
.Select(m => m.Id)
|
.Select(m => m.Id)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
var existingMembersInGroup = (await ctx.Database.Execute(conn => conn.QueryMemberList(target.System,
|
var existingMembersInGroup = (await ctx.Database.Execute(conn => conn.QueryMemberList(target.System,
|
||||||
new DatabaseViewsExt.ListQueryOptions { GroupFilter = target.Id })))
|
new DatabaseViewsExt.ListQueryOptions { GroupFilter = target.Id })))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue