From 5f71fbcb796be8b0cf2f4c44801a5d5a431ee708 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sun, 18 May 2025 13:31:33 -0500 Subject: [PATCH] Fixed juicer message cleanup basically never working due to retarded logic --- KfChatDotNetBot/Commands/JuiceCommand.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/KfChatDotNetBot/Commands/JuiceCommand.cs b/KfChatDotNetBot/Commands/JuiceCommand.cs index 8488d4d..bd3f41f 100644 --- a/KfChatDotNetBot/Commands/JuiceCommand.cs +++ b/KfChatDotNetBot/Commands/JuiceCommand.cs @@ -44,7 +44,7 @@ public class JuiceCommand : ICommand return; } - if (lastJuicer.Count == 0) + if (lastJuicer.Count == 0 || (lastJuicer[0].JuicedAt.AddSeconds(cooldown) - DateTimeOffset.UtcNow).TotalSeconds <= 0) { var sentMsg = await botInstance.SendChatMessageAsync($"!juice {message.Author.Id} {amount}", true); await db.Juicers.AddAsync(new JuicerDbModel @@ -65,14 +65,6 @@ public class JuiceCommand : ICommand } var secondsRemaining = lastJuicer[0].JuicedAt.AddSeconds(cooldown) - DateTimeOffset.UtcNow; - if (secondsRemaining.TotalSeconds <= 0) - { - await botInstance.SendChatMessageAsync($"!juice {message.Author.Id} {amount}", true); - await db.Juicers.AddAsync(new JuicerDbModel - { Amount = amount, User = user, JuicedAt = DateTimeOffset.UtcNow }, ctx); - await db.SaveChangesAsync(ctx); - return; - } await botInstance.SendChatMessageAsync($"You gotta wait {secondsRemaining.Humanize(precision: 2, minUnit: TimeUnit.Second)} for another juicer", true); }