#nullable enable using System.Threading.Tasks; using BotFramework.Attributes; using BotFramework.Enums; using Kruzya.TelegramBot.Core.Data; using Telegram.Bot; namespace West.TelegramBot.ChatManagement.Handler.Fun { public class Bayan : AbstractAnimationReply { public Bayan(CoreContext db) : base(db) { } protected override string GetAnimationName() { return "bayan"; } [Command(InChat.Public, "setbayan", CommandParseMode.Both)] public async Task HandleSetBayan() { await HandleSetAnimation(); } [Message(InChat.Public, "(?i)баян|боян", regex: true)] public async Task HandleBayan() { var msg = Message; var replyMsg = msg?.ReplyToMessage; if (msg == null || replyMsg == null || replyMsg.From!.IsBot || !await HandleAnimation(replyMsg.MessageId)) { return; } await Bot.DeleteMessageAsync(Chat.Id, msg.MessageId); } } }