Support future dates for rehab end time

This commit is contained in:
barelyprofessional
2025-04-21 15:24:18 -05:00
parent 3951671b01
commit a0e44bd9d9

View File

@@ -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);
}
}