Add rate limit to the image command

This commit is contained in:
barelyprofessional
2025-09-12 20:23:05 -05:00
parent cbebdb2144
commit d76f427621

View File

@@ -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)
{