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
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)