From a0e44bd9d948ee721f860148f88f96d19668f7af Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Mon, 21 Apr 2025 15:24:18 -0500 Subject: [PATCH] Support future dates for rehab end time --- KfChatDotNetBot/Commands/MemeCommands.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Commands/MemeCommands.cs b/KfChatDotNetBot/Commands/MemeCommands.cs index 1ecfb15..3c842f9 100644 --- a/KfChatDotNetBot/Commands/MemeCommands.cs +++ b/KfChatDotNetBot/Commands/MemeCommands.cs @@ -96,8 +96,15 @@ public class RehabCommand : ICommand await botInstance.SendChatMessageAsync("Austin's rehab end date was null", true); return; } - var timespan = DateTimeOffset.Parse(end.Value) - DateTimeOffset.UtcNow; - await botInstance.SendChatMessageAsync($"AustinGambles was kicked out of rehab {timespan.Humanize(precision:3)} ago", true); + + var endDate = DateTimeOffset.Parse(end.Value); + var timespan = endDate - DateTimeOffset.UtcNow; + if (endDate > DateTimeOffset.UtcNow) + { + await botInstance.SendChatMessageAsync($"austingambles should finish rehab in {timespan.Humanize(precision:3)}", true); + return; + } + await botInstance.SendChatMessageAsync($"austingambles was kicked out of rehab {timespan.Humanize(precision:3)} ago", true); } }