mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +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);
|
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 })))
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ You cannot look up private members or groups of another system.
|
||||||
|pk;system frontpercent|-flat||Show "flat" frontpercent - percentages add up to 100%|
|
|pk;system frontpercent|-flat||Show "flat" frontpercent - percentages add up to 100%|
|
||||||
|pk;group \<group> frontpercent|-fronters-only|-fo|Show a group's frontpercent without the "no fronter" entry|
|
|pk;group \<group> frontpercent|-fronters-only|-fo|Show a group's frontpercent without the "no fronter" entry|
|
||||||
|pk;group \<group> frontpercent|-flat||Show "flat" frontpercent - percentages add up to 100%|
|
|pk;group \<group> frontpercent|-flat||Show "flat" frontpercent - percentages add up to 100%|
|
||||||
|
|pk;group \<group> \<add/remove>|-all|-a|Add or remove all members from a group.|
|
||||||
|pk;edit|-append|-a|Append the new content to the old message instead of overwriting it|
|
|pk;edit|-append|-a|Append the new content to the old message instead of overwriting it|
|
||||||
|pk;edit|-prepend|-p|Prepend the new content to the old message instead of overwriting it|
|
|pk;edit|-prepend|-p|Prepend the new content to the old message instead of overwriting it|
|
||||||
|pk;edit|-nospace|-ns|Append/prepend without adding a space|
|
|pk;edit|-nospace|-ns|Append/prepend without adding a space|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue