feat: make group member add/remove response code less confusing; add tests

This commit is contained in:
spiral 2021-08-25 19:51:33 -04:00
parent 82544cf9ce
commit f912805ecc
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
5 changed files with 296 additions and 33 deletions

View file

@ -457,7 +457,7 @@ namespace PluralKit.Bot
}
else return; // otherwise toAction "may be undefined"
await ctx.Reply(MiscUtils.GroupAddRemoveResponse<MemberId>(members, toAction, op));
await ctx.Reply(GroupAddRemoveResponseService.GenerateResponse(op, members.Count, 1, members.Count - existingMembersInGroup.Count, existingMembersInGroup.Count));
}
public async Task ListGroupMembers(Context ctx, PKGroup target)

View file

@ -55,7 +55,7 @@ namespace PluralKit.Bot
}
else return; // otherwise toAction "may be unassigned"
await ctx.Reply(MiscUtils.GroupAddRemoveResponse<GroupId>(groups, toAction, op));
await ctx.Reply(GroupAddRemoveResponseService.GenerateResponse(op, 1, groups.Count, groups.Count - existingGroups.Count, existingGroups.Count));
}
public async Task List(Context ctx, PKMember target)