From d76f427621f861ad10f58a9cb22f8c3ce2e8242d Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Fri, 12 Sep 2025 20:23:05 -0500 Subject: [PATCH] Add rate limit to the image command --- KfChatDotNetBot/Commands/ImageCommands.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/KfChatDotNetBot/Commands/ImageCommands.cs b/KfChatDotNetBot/Commands/ImageCommands.cs index 447174d..3070689 100644 --- a/KfChatDotNetBot/Commands/ImageCommands.cs +++ b/KfChatDotNetBot/Commands/ImageCommands.cs @@ -138,7 +138,12 @@ public class GetRandomImage : ICommand public string? HelpText => "Get a random image"; public UserRight RequiredRight => UserRight.Loser; public TimeSpan Timeout => TimeSpan.FromMinutes(10); - public RateLimitOptionsModel? RateLimitOptions => null; + public RateLimitOptionsModel? RateLimitOptions => new() + { + Window = TimeSpan.FromSeconds(30), + MaxInvocations = 7, + Flags = RateLimitFlags.UseEntireMessage + }; public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx) {