mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Log animation handler triggers.
This commit is contained in:
@@ -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>() > DateTime.Now)
|
||||
var nextUseDt = lastUseOption.GetValue<DateTime>();
|
||||
if (nextUseDt > DateTime.Now)
|
||||
{
|
||||
_logger.LogInformation("{Name} is on cooldown for Chat {ChatTitle}. Will be available at {Time}",
|
||||
GetAnimationName(), Chat.Title, lastUseOption.GetValue<DateTime>());
|
||||
GetAnimationName(), Chat.Title, nextUseDt);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user