From 8d02af7b94cd63119542bbbb3b8fa61646701329 Mon Sep 17 00:00:00 2001 From: spiral Date: Sun, 31 Oct 2021 01:11:10 -0400 Subject: [PATCH] refactor: move GroupAddRemoveResponseService into GroupMemberUtils (it's not a service) --- PluralKit.Bot/Commands/Groups.cs | 2 +- PluralKit.Bot/Commands/MemberGroup.cs | 2 +- .../GroupMemberUtils.cs} | 2 +- PluralKit.Tests/GroupAddRemoveResponseTests.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename PluralKit.Bot/{Services/GroupAddRemoveResponseService.cs => Utils/GroupMemberUtils.cs} (98%) diff --git a/PluralKit.Bot/Commands/Groups.cs b/PluralKit.Bot/Commands/Groups.cs index e5539384..f629c60f 100644 --- a/PluralKit.Bot/Commands/Groups.cs +++ b/PluralKit.Bot/Commands/Groups.cs @@ -466,7 +466,7 @@ namespace PluralKit.Bot } else return; // otherwise toAction "may be undefined" - await ctx.Reply(GroupAddRemoveResponseService.GenerateResponse(op, members.Count, 1, toAction.Count, members.Count - toAction.Count)); + await ctx.Reply(GroupMemberUtils.GenerateResponse(op, members.Count, 1, toAction.Count, members.Count - toAction.Count)); } public async Task ListGroupMembers(Context ctx, PKGroup target) diff --git a/PluralKit.Bot/Commands/MemberGroup.cs b/PluralKit.Bot/Commands/MemberGroup.cs index 8be13ff1..90bc1f17 100644 --- a/PluralKit.Bot/Commands/MemberGroup.cs +++ b/PluralKit.Bot/Commands/MemberGroup.cs @@ -54,7 +54,7 @@ namespace PluralKit.Bot } else return; // otherwise toAction "may be unassigned" - await ctx.Reply(GroupAddRemoveResponseService.GenerateResponse(op, 1, groups.Count, toAction.Count, groups.Count - toAction.Count)); + await ctx.Reply(GroupMemberUtils.GenerateResponse(op, 1, groups.Count, toAction.Count, groups.Count - toAction.Count)); } public async Task List(Context ctx, PKMember target) diff --git a/PluralKit.Bot/Services/GroupAddRemoveResponseService.cs b/PluralKit.Bot/Utils/GroupMemberUtils.cs similarity index 98% rename from PluralKit.Bot/Services/GroupAddRemoveResponseService.cs rename to PluralKit.Bot/Utils/GroupMemberUtils.cs index 75049fd7..0a3ee79f 100644 --- a/PluralKit.Bot/Services/GroupAddRemoveResponseService.cs +++ b/PluralKit.Bot/Utils/GroupMemberUtils.cs @@ -4,7 +4,7 @@ using PluralKit.Core; namespace PluralKit.Bot { - public static class GroupAddRemoveResponseService + public static class GroupMemberUtils { public static string GenerateResponse(Groups.AddRemoveOperation action, int memberCount, int groupCount, int actionedOn, int notActionedOn) { diff --git a/PluralKit.Tests/GroupAddRemoveResponseTests.cs b/PluralKit.Tests/GroupAddRemoveResponseTests.cs index 0d91633a..7184bef1 100644 --- a/PluralKit.Tests/GroupAddRemoveResponseTests.cs +++ b/PluralKit.Tests/GroupAddRemoveResponseTests.cs @@ -10,7 +10,7 @@ namespace PluralKit.Tests public class GroupAddRemoveResponseTests { private static Func - func = GroupAddRemoveResponseService.GenerateResponse; + func = GroupMemberUtils.GenerateResponse; private static Groups.AddRemoveOperation addOp = Groups.AddRemoveOperation.Add; private static Groups.AddRemoveOperation removeOp = Groups.AddRemoveOperation.Remove; private static string success = Emojis.Success;