diff --git a/src/FMBot.Bot/Builders/ImportBuilders.cs b/src/FMBot.Bot/Builders/ImportBuilders.cs index 66ea289e..564af3a4 100644 --- a/src/FMBot.Bot/Builders/ImportBuilders.cs +++ b/src/FMBot.Bot/Builders/ImportBuilders.cs @@ -72,7 +72,7 @@ public ResponseModel ImportInstructionsPickSource(ContextModel context) return response; } - public async Task GetSpotifyImportInstructions(ContextModel context, bool directToSlash = false) + public async Task GetSpotifyImportInstructions(ContextModel context, bool warnAgainstPublicFiles = false) { var response = new ResponseModel { @@ -99,15 +99,14 @@ public async Task GetSpotifyImportInstructions(ContextModel conte var importDescription = new StringBuilder(); importDescription.AppendLine("1. Download the file Spotify provided"); - importDescription.AppendLine(context.SlashCommand - ? "2. Use this command and add the `.zip` file as an attachment through the options" - : $"2. Use `/import Spotify` and add the `.zip` file as an attachment through the options"); + importDescription.AppendLine($"2. Use `/import spotify` slash command and add the `.zip` file as an attachment through the options"); importDescription.AppendLine("3. Having issues? You can also attach each `.json` file separately"); response.Embed.AddField($"{DiscordConstants.Imports} Importing your data into .fmbot", importDescription.ToString()); var notesDescription = new StringBuilder(); - notesDescription.AppendLine("- We filter out duplicates and skips, so don't worry about submitting the same file twice"); + notesDescription.AppendLine( + "- We filter out duplicates and skips, so don't worry about submitting the same file twice"); notesDescription.AppendLine("- The importing service is only available with an active supporter subscription"); response.Embed.AddField("📝 Notes", notesDescription.ToString()); @@ -120,10 +119,9 @@ public async Task GetSpotifyImportInstructions(ContextModel conte } var footer = new StringBuilder(); - if (!context.SlashCommand || directToSlash) + if (warnAgainstPublicFiles) { footer.AppendLine("Do not share your import files publicly"); - footer.AppendLine("To start your import, use the slash command version of this command instead"); } footer.AppendLine("Having issues with importing? Please open a help thread on discord.gg/fmbot"); @@ -142,7 +140,7 @@ public async Task GetSpotifyImportInstructions(ContextModel conte return response; } - public async Task GetAppleMusicImportInstructions(ContextModel context, bool directToSlash = false) + public async Task GetAppleMusicImportInstructions(ContextModel context, bool warnAgainstPublicFiles = false) { var response = new ResponseModel { @@ -167,17 +165,10 @@ public async Task GetAppleMusicImportInstructions(ContextModel co var importDescription = new StringBuilder(); importDescription.AppendLine("1. Download the file Apple provided"); - if (context.SlashCommand) - { - importDescription.AppendLine("2. Use this command and add the `.zip` file as an attachment through the options"); - } - else - { - importDescription.AppendLine( - $"2. Use `/import applemusic` and add the `.zip` file as an attachment through the options"); - } importDescription.AppendLine( - "3. Got multiple zip files? You can try them all until one succeeds. Only one of them contains your play history."); + "2. Use `/import applemusic` slash command and add the `.zip` file as an attachment through the options"); + importDescription.AppendLine( + "3. Got multiple zip files? You can try them all until one succeeds. Only one of them contains your play history"); importDescription.AppendLine( "4. Having issues? You can also attach the `Apple Music Play Activity.csv` file separately"); @@ -185,8 +176,10 @@ public async Task GetAppleMusicImportInstructions(ContextModel co importDescription.ToString()); var notes = new StringBuilder(); - notes.AppendLine("- Apple provides their history data without artist names. We try to find these as best as possible based on the album and track name."); - notes.AppendLine("- Exceeding Discord file limits? Try on [our server](https://discord.gg/fmbot) in #commands."); + notes.AppendLine( + "- Apple provides their history data without artist names. We try to find these as best as possible based on the album and track name."); + notes.AppendLine( + "- Exceeding Discord file limits? Try on [our server](https://discord.gg/fmbot) in #commands."); notes.AppendLine("- The importing service is only available with an active supporter subscription"); response.Embed.AddField("📝 Notes", notes.ToString()); @@ -199,10 +192,9 @@ public async Task GetAppleMusicImportInstructions(ContextModel co } var footer = new StringBuilder(); - if (!context.SlashCommand || directToSlash) + if (warnAgainstPublicFiles) { footer.AppendLine("Do not share your import files publicly"); - footer.AppendLine("To start your import, use the slash command version of this command instead"); } footer.AppendLine("Having issues with importing? Please open a help thread on discord.gg/fmbot"); diff --git a/src/FMBot.Bot/SlashCommands/UserSlashCommands.cs b/src/FMBot.Bot/SlashCommands/UserSlashCommands.cs index fe60b555..2a48e9f0 100644 --- a/src/FMBot.Bot/SlashCommands/UserSlashCommands.cs +++ b/src/FMBot.Bot/SlashCommands/UserSlashCommands.cs @@ -1462,8 +1462,7 @@ public async Task ImportInstructionsSpotify() try { var response = - await this._importBuilders.GetSpotifyImportInstructions(new ContextModel(this.Context, contextUser), - true); + await this._importBuilders.GetSpotifyImportInstructions(new ContextModel(this.Context, contextUser), true); await this.Context.UpdateInteractionEmbed(response); this.Context.LogCommandUsed(response.CommandResponse); @@ -1483,8 +1482,7 @@ public async Task ImportInstructionsAppleMusic() try { var response = - await this._importBuilders.GetAppleMusicImportInstructions(new ContextModel(this.Context, contextUser), - true); + await this._importBuilders.GetAppleMusicImportInstructions(new ContextModel(this.Context, contextUser), true); await this.Context.UpdateInteractionEmbed(response); this.Context.LogCommandUsed(response.CommandResponse); diff --git a/src/FMBot.Bot/TextCommands/ImportCommands.cs b/src/FMBot.Bot/TextCommands/ImportCommands.cs index e56ff2be..5f4c586c 100644 --- a/src/FMBot.Bot/TextCommands/ImportCommands.cs +++ b/src/FMBot.Bot/TextCommands/ImportCommands.cs @@ -58,11 +58,11 @@ public async Task ImportSpotifyAsync([Remainder] string _ = null) ResponseModel response; if (this.Context.Message.Content.Contains("spotify", StringComparison.OrdinalIgnoreCase)) { - response = await this._importBuilders.GetSpotifyImportInstructions(new ContextModel(this.Context, prfx, userSettings)); + response = await this._importBuilders.GetSpotifyImportInstructions(new ContextModel(this.Context, prfx, userSettings), true); } else if (this.Context.Message.Content.Contains("apple", StringComparison.OrdinalIgnoreCase)) { - response = await this._importBuilders.GetAppleMusicImportInstructions(new ContextModel(this.Context, prfx, userSettings)); + response = await this._importBuilders.GetAppleMusicImportInstructions(new ContextModel(this.Context, prfx, userSettings), true); } else {