Skip to content

Commit

Permalink
fix text
Browse files Browse the repository at this point in the history
  • Loading branch information
th0mk committed Jan 8, 2025
1 parent 2b7d61b commit 0dc392f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 28 deletions.
36 changes: 14 additions & 22 deletions src/FMBot.Bot/Builders/ImportBuilders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public ResponseModel ImportInstructionsPickSource(ContextModel context)
return response;
}

public async Task<ResponseModel> GetSpotifyImportInstructions(ContextModel context, bool directToSlash = false)
public async Task<ResponseModel> GetSpotifyImportInstructions(ContextModel context, bool warnAgainstPublicFiles = false)
{
var response = new ResponseModel
{
Expand All @@ -99,15 +99,14 @@ public async Task<ResponseModel> 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());

Expand All @@ -120,10 +119,9 @@ public async Task<ResponseModel> 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");
Expand All @@ -142,7 +140,7 @@ public async Task<ResponseModel> GetSpotifyImportInstructions(ContextModel conte
return response;
}

public async Task<ResponseModel> GetAppleMusicImportInstructions(ContextModel context, bool directToSlash = false)
public async Task<ResponseModel> GetAppleMusicImportInstructions(ContextModel context, bool warnAgainstPublicFiles = false)
{
var response = new ResponseModel
{
Expand All @@ -167,26 +165,21 @@ public async Task<ResponseModel> 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");

response.Embed.AddField($"{DiscordConstants.Imports} Importing your data into .fmbot",
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());

Expand All @@ -199,10 +192,9 @@ public async Task<ResponseModel> 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");
Expand Down
6 changes: 2 additions & 4 deletions src/FMBot.Bot/SlashCommands/UserSlashCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/FMBot.Bot/TextCommands/ImportCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 0dc392f

Please sign in to comment.