From 2acc36d52ac3599890df87c0e0880b20d6830887 Mon Sep 17 00:00:00 2001 From: Andriy <30056636+West14@users.noreply.github.com> Date: Fri, 29 Jul 2022 12:20:24 +0300 Subject: [PATCH 1/2] [entertainment] add animation set message, fix HandleAnimation method visibility --- modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs b/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs index ce81450..d07e6fc 100644 --- a/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs +++ b/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs @@ -51,10 +51,11 @@ namespace West.Entertainment.Handler.Fun var animationFileOption = await GetAnimationFileOption(); animationFileOption.SetValue(animation.FileId); _db.AddOrUpdate(animationFileOption); + + await Bot.SendTextMessageAsync(Chat.Id, "Animation has been set.", replyToMessageId: Message!.ReplyToMessage!.MessageId); } - // ReSharper disable once MemberCanBeProtected.Global - public virtual async Task HandleAnimation() + protected virtual async Task HandleAnimation() { var text = Message!.Text!.ToLower(); if (!AnimationMatch.IsMatch(text.ToLower()) || text.StartsWith("/set") || !CanHandle()) return false; From dd6c896b0841af6c9fad97500ea014f5b3439360 Mon Sep 17 00:00:00 2001 From: Andriy <30056636+West14@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:11:13 +0300 Subject: [PATCH 2/2] [entertainment] remove unused CanPunish method --- modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs b/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs index d07e6fc..3689789 100644 --- a/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs +++ b/modules/Entertainment/Handler/Fun/AbstractAnimationReply.cs @@ -100,11 +100,6 @@ namespace West.Entertainment.Handler.Fun { return await _db.UserValues.FindOrCreateOption(Chat.Id, $"{GetAnimationName()}NextUse"); } - - private async Task CanPunish() - { - return RepliedUser != null && await Bot.CanPunishMember(Chat, From, RepliedUser); - } protected virtual int? GetMessageIdToReply() => Message?.MessageId; }