From e77ef7a9bd06f26386d0607532849b2349dd5950 Mon Sep 17 00:00:00 2001 From: West14 <30056636+West14@users.noreply.github.com> Date: Wed, 29 Dec 2021 01:32:14 +0200 Subject: [PATCH] Fix bayan reply to bot. --- modules/ChatManagement/Handler/Fun/Bayan.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ChatManagement/Handler/Fun/Bayan.cs b/modules/ChatManagement/Handler/Fun/Bayan.cs index 380a164..1fb35b2 100644 --- a/modules/ChatManagement/Handler/Fun/Bayan.cs +++ b/modules/ChatManagement/Handler/Fun/Bayan.cs @@ -23,11 +23,12 @@ namespace West.TelegramBot.ChatManagement.Handler.Fun await HandleSetAnimation(); } - [Message(InChat.Public, "(?i)баян", MessageFlag.IsReply, true)] + [Message(InChat.Public, "(?i)баян|боян", regex: true)] public async Task HandleBayan() { var msg = Message; - if (msg == null || !await HandleAnimation(msg.ReplyToMessage!.MessageId)) + var replyMsg = msg?.ReplyToMessage; + if (msg == null || replyMsg == null || replyMsg.From!.IsBot || !await HandleAnimation(replyMsg.MessageId)) { return; }