Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
th0mk committed Nov 29, 2024
1 parent 9005e5b commit eaee336
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/FMBot.Bot/Builders/CrownBuilders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using FMBot.Bot.Resources;
using Discord.Interactions;
using FMBot.Bot.Factories;
using FMBot.Domain;

namespace FMBot.Bot.Builders;

Expand Down Expand Up @@ -210,7 +211,8 @@ public async Task<ResponseModel> CrownOverviewAsync(
else
{
response.Embed.WithDescription($"You or the user you're searching for don't have any crowns yet. \n\n" +
$"Use `{context.Prefix}whoknows` to start getting crowns!");
$"Use `{context.Prefix}whoknows` to start getting crowns!\n\n" +
$"Crowns are rewarded to the #1 listener for an artist with at least {guild.CrownsMinimumPlaycountThreshold ?? Constants.DefaultPlaysForCrown} plays.");
}

response.ResponseType = ResponseType.Embed;
Expand Down
3 changes: 2 additions & 1 deletion src/FMBot.Bot/Builders/RecapBuilders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public async Task<ResponseModel> RecapAsync(ContextModel context,
{
var response = new ResponseModel
{
ResponseType = ResponseType.Embed
ResponseType = ResponseType.Embed,
Stream = null
};

var footer = new StringBuilder();
Expand Down
12 changes: 10 additions & 2 deletions src/FMBot.Bot/Extensions/InteractionContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ await message.ModifyAsync(m =>
}
}

private static Task ModifyPaginator(this IInteractionContext context, InteractiveService interactiveService,
private static async Task ModifyPaginator(this IInteractionContext context, InteractiveService interactiveService,
IUserMessage message, ResponseModel response)
{
if (context.Interaction.IntegrationOwners.ContainsKey(ApplicationIntegrationType.UserInstall) &&
Expand All @@ -450,12 +450,20 @@ private static Task ModifyPaginator(this IInteractionContext context, Interactiv
}
else
{
if (message.Attachments != null && message.Attachments.Any())
{
await message.ModifyAsync(m =>
{
m.Attachments = null;
});
}

_ = interactiveService.SendPaginatorAsync(
response.StaticPaginator.Build(),
message,
TimeSpan.FromMinutes(DiscordConstants.PaginationTimeoutInSeconds));
}

return Task.CompletedTask;
return;
}
}
1 change: 1 addition & 0 deletions src/FMBot.Bot/Resources/InteractionConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static class Discogs

public const string ImportManage = "user-import-manage";
public const string ImportSetting = "user-import-setting";
public const string ImportModify = "user-import-modify";
public const string ImportClearSpotify = "user-import-clear-spotify";
public const string ImportClearAppleMusic = "user-import-clear-applemusic";

Expand Down
2 changes: 1 addition & 1 deletion src/FMBot.Bot/Services/SupporterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ public async Task UpdateDiscordSupporters(List<DiscordEntitlement> discordSuppor
public async Task CheckExpiredDiscordSupporters()
{
var expiredDate = DateTime.UtcNow.AddDays(-3);
var modifiedDate = DateTime.UtcNow.AddDays(-35);
var modifiedDate = DateTime.UtcNow.AddDays(-20);

await using var db = await this._contextFactory.CreateDbContextAsync();
var possiblyExpiredSupporters = await db.Supporters
Expand Down
3 changes: 2 additions & 1 deletion src/FMBot.Bot/TextCommands/LastFM/PlayCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public async Task OverviewAsync([Remainder] string extraOptions = null)

[Command("year", RunMode = RunMode.Async)]
[Summary("Shows an overview of your year")]
[Alias("yr", "lastyear", "yearoverview", "yearov", "yov", "last.year", "wrapped")]
[Alias("yr", "lastyear", "yearoverview", "yearov", "yov", "last.year")]
[UsernameSetRequired]
[CommandCategories(CommandCategory.Tracks, CommandCategory.Albums, CommandCategory.Artists)]
public async Task YearAsync([Remainder] string extraOptions = null)
Expand Down Expand Up @@ -272,6 +272,7 @@ public async Task YearAsync([Remainder] string extraOptions = null)
[UsernameSetRequired]
[CommandCategories(CommandCategory.Tracks, CommandCategory.Albums, CommandCategory.Artists)]
[ExcludeFromHelp]
[Alias("rcp", "wrapped")]
public async Task RecapAsync([Remainder] string extraOptions = null)
{
_ = this.Context.Channel.TriggerTypingAsync();
Expand Down

0 comments on commit eaee336

Please sign in to comment.