mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
#nullable enable
|
|
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading.Tasks;
|
|
using BotFramework.Attributes;
|
|
using BotFramework.Enums;
|
|
using Kruzya.TelegramBot.Core;
|
|
using Kruzya.TelegramBot.Core.Data;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace West.Entertainment.Handler.Fun
|
|
{
|
|
public class Python : AbstractAnimationReply
|
|
{
|
|
protected override Regex AnimationMatch =>
|
|
new("питон|пайтон|python|путхон|питухон|петухон",
|
|
RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
|
|
|
protected override string GetAnimationName()
|
|
=> "python";
|
|
|
|
[InChat(InChat.Public)]
|
|
[Command("setpython", CommandParseMode.Both)]
|
|
public async Task HandleSetPython()
|
|
=> await HandleSetAnimation();
|
|
|
|
[InChat(InChat.Public)]
|
|
[Message(MessageFlag.HasText)]
|
|
public async Task HandlePython()
|
|
{
|
|
await HandleAnimation();
|
|
}
|
|
|
|
public Python(CoreContext db, ILogger<Python> logger, ThreadSafeRandom rng) : base(db, logger, rng) { }
|
|
}
|
|
} |