diff --git a/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs b/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs index e157dca..ce81450 100644 --- a/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs +++ b/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs @@ -43,7 +43,10 @@ namespace West.Entertainment.Handler.Fun protected async Task HandleSetAnimation() { var animation = Message?.ReplyToMessage?.Animation; - if (await CanPunish() || animation == null) return; + var isAdmin = await Bot.IsUserAdminAsync(Chat, From); + + _logger.LogDebug("IsAdmin: {IsAdmin}. FileId: {FileId}", isAdmin, animation?.FileId); + if (!isAdmin || animation == null) return; var animationFileOption = await GetAnimationFileOption(); animationFileOption.SetValue(animation.FileId); @@ -61,8 +64,13 @@ namespace West.Entertainment.Handler.Fun _logger.LogDebug("Animation: {Text}, ToLower: {ToLowerText}", Message!.Text, Message!.Text!.ToLower()); - - if (animationFileId.IsNullOrEmpty()) return false; + _logger.LogDebug("AnimationFileId: {FileId}", animationFileId); + + if (animationFileId.IsNullOrEmpty()) + { + _logger.LogDebug("AnimationFileId is empty. Ignoring."); + return false; + } var nextUseDt = nextUseOption.GetValue(); if (nextUseDt > DateTime.Now)