mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(bot): -all flag to add/remove all members from group
This commit is contained in:
parent
4bd4407771
commit
93264cbf20
2 changed files with 14 additions and 1 deletions
|
|
@ -86,10 +86,22 @@ public class GroupMember
|
|||
{
|
||||
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)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
}
|
||||
|
||||
var existingMembersInGroup = (await ctx.Database.Execute(conn => conn.QueryMemberList(target.System,
|
||||
new DatabaseViewsExt.ListQueryOptions { GroupFilter = target.Id })))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue