From d7e6290d46f8835ec71605f4d7353a057fa5cfe5 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Mon, 8 Sep 2025 19:37:18 -0500 Subject: [PATCH] Do not store rate limits for the GetRandomImage command unless a real key is specified --- KfChatDotNetBot/Commands/ImageCommands.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/KfChatDotNetBot/Commands/ImageCommands.cs b/KfChatDotNetBot/Commands/ImageCommands.cs index 5d67e07..a524d0f 100644 --- a/KfChatDotNetBot/Commands/ImageCommands.cs +++ b/KfChatDotNetBot/Commands/ImageCommands.cs @@ -151,7 +151,11 @@ public class GetRandomImage : ICommand await using var db = new ApplicationDbContext(); var key = arguments["key"].Value.ToLower(); var images = db.Images.Where(i => i.Key == key); - if (!await images.AnyAsync(ctx)) return; + if (!await images.AnyAsync(ctx)) + { + RateLimitService.RemoveMostRecentEntry(user, this); + return; + } var settings = await SettingsProvider.GetMultipleValuesAsync([ BuiltIn.Keys.BotImageRandomSliceDivideBy, BuiltIn.Keys.BotImagePigCubeSelfDestruct, BuiltIn.Keys.BotImageInvertedCubeUrl, BuiltIn.Keys.BotImagePigCubeSelfDestructMin,