diff --git a/KfChatDotNetBot/Commands/KasinoUserCommands.cs b/KfChatDotNetBot/Commands/KasinoUserCommands.cs index facd7b1..9f4b6b1 100644 --- a/KfChatDotNetBot/Commands/KasinoUserCommands.cs +++ b/KfChatDotNetBot/Commands/KasinoUserCommands.cs @@ -128,8 +128,7 @@ public class RakebackCommand : ICommand public RateLimitOptionsModel? RateLimitOptions => new RateLimitOptionsModel { MaxInvocations = 1, - Window = TimeSpan.FromSeconds(30), - Flags = RateLimitFlags.AutoDeleteCooldownResponse + Window = TimeSpan.FromSeconds(30) }; public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx) @@ -182,8 +181,7 @@ public class LossbackCommand : ICommand public RateLimitOptionsModel? RateLimitOptions => new RateLimitOptionsModel { Window = TimeSpan.FromSeconds(30), - MaxInvocations = 1, - Flags = RateLimitFlags.AutoDeleteCooldownResponse + MaxInvocations = 1 }; public async Task RunCommand(ChatBot botInstance, MessageModel message, UserDbModel user, GroupCollection arguments, CancellationToken ctx) diff --git a/KfChatDotNetBot/Models/RateLimitModels.cs b/KfChatDotNetBot/Models/RateLimitModels.cs index 254aa9e..8abc9af 100644 --- a/KfChatDotNetBot/Models/RateLimitModels.cs +++ b/KfChatDotNetBot/Models/RateLimitModels.cs @@ -76,8 +76,7 @@ public enum RateLimitFlags /// ExemptPrivilegedUsers, /// - /// Automatically clean up the cooldown response sent to a user - /// Mutually exclusive with NoResponse + /// Do not automatically clean up the cooldown response sent to a user /// - AutoDeleteCooldownResponse + NoAutoDeleteCooldownResponse } \ No newline at end of file diff --git a/KfChatDotNetBot/Services/BotCommands.cs b/KfChatDotNetBot/Services/BotCommands.cs index d3be74b..033d7dc 100644 --- a/KfChatDotNetBot/Services/BotCommands.cs +++ b/KfChatDotNetBot/Services/BotCommands.cs @@ -158,7 +158,7 @@ internal class BotCommands if (options.Flags.HasFlag(RateLimitFlags.NoResponse)) return; var timeRemaining = oldestEntryExpires - DateTimeOffset.UtcNow; var message = await _bot.SendChatMessageAsync($"{user.FormatUsername()}, please wait {timeRemaining.Humanize(maxUnit: TimeUnit.Minute, minUnit: TimeUnit.Millisecond, precision: 2)} before attempting to run {commandName} again.", true); - if (!options.Flags.HasFlag(RateLimitFlags.AutoDeleteCooldownResponse)) return; + if (options.Flags.HasFlag(RateLimitFlags.NoAutoDeleteCooldownResponse)) return; var i = 0; while (message.ChatMessageId == null) {