mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Animation trigger refactoring. BAYAN.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#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)баян", MessageFlag.IsReply, true)]
|
||||
public async Task HandleBayan()
|
||||
{
|
||||
var msg = Message;
|
||||
if (msg == null || !await HandleAnimation(msg.ReplyToMessage!.MessageId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await Bot.DeleteMessageAsync(Chat.Id, msg.MessageId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user