From 5678de8531c66f00adeb2369923e06a7e05ebf40 Mon Sep 17 00:00:00 2001 From: West14 <30056636+West14@users.noreply.github.com> Date: Mon, 3 Jan 2022 19:22:03 +0200 Subject: [PATCH] Log animation handler triggers. --- .../Handler/Fun/AbstractAnimationReply.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs b/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs index a733a2f..507b44c 100644 --- a/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs +++ b/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs @@ -56,14 +56,18 @@ namespace West.Entertainment.Handler.Fun var animationFileId = (await GetAnimationFileOption()).GetValue(string.Empty); var lastUseOption = await GetLastUseOption(); + _logger.LogInformation("Animation: {Text}, ToLower: {ToLowerText}", + Message!.Text, Message!.Text!.ToLower()); + if (animationFileId.IsNullOrEmpty() || !AnimationMatch.IsMatch(Message!.Text!.ToLower()) || !CanHandle()) return false; - - if (lastUseOption.GetValue() > DateTime.Now) + + var nextUseDt = lastUseOption.GetValue(); + if (nextUseDt > DateTime.Now) { _logger.LogInformation("{Name} is on cooldown for Chat {ChatTitle}. Will be available at {Time}", - GetAnimationName(), Chat.Title, lastUseOption.GetValue()); + GetAnimationName(), Chat.Title, nextUseDt); return false; }