From 3d21adeec905617a1181214de0bf9ae3f3ecd6d7 Mon Sep 17 00:00:00 2001 From: Noko Date: Sun, 20 Oct 2019 02:22:22 -0500 Subject: [PATCH] Fix reversal of import response messages Some of the command rewrite changes resulted in the response messages for importing a system being swapped. When importing without an existing system (ctx.System == null), we want to display the "new system" message. Otherwise, show the count added/modified. --- PluralKit.Bot/Commands/ImportExportCommands.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Commands/ImportExportCommands.cs b/PluralKit.Bot/Commands/ImportExportCommands.cs index e3c05264..d07bb964 100644 --- a/PluralKit.Bot/Commands/ImportExportCommands.cs +++ b/PluralKit.Bot/Commands/ImportExportCommands.cs @@ -103,12 +103,14 @@ namespace PluralKit.Bot.Commands var result = await _dataFiles.ImportSystem(data, ctx.System, ctx.Author.Id); if (!result.Success) await ctx.Reply($"{Emojis.Error} The provided system profile could not be imported. {result.Message}"); - else if (ctx.System != null) + else if (ctx.System == null) { + // We didn't have a system prior to importing, so give them the new system's ID await ctx.Reply($"{Emojis.Success} PluralKit has created a system for you based on the given file. Your system ID is `{result.System.Hid}`. Type `pk;system` for more information."); } else { + // We already had a system, so show them what changed await ctx.Reply($"{Emojis.Success} Updated {result.ModifiedNames.Count} members, created {result.AddedNames.Count} members. Type `pk;system list` to check!"); } }