Files
telegram-bot/modules/Entertainment/Handler/Fun/Python.cs
T

36 lines
1.1 KiB
C#
Raw Normal View History

2022-01-02 21:56:14 +02:00
#nullable enable
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BotFramework.Attributes;
using BotFramework.Enums;
using Kruzya.TelegramBot.Core;
2022-01-02 21:56:14 +02:00
using Kruzya.TelegramBot.Core.Data;
2022-01-03 15:55:42 +02:00
using Microsoft.Extensions.Logging;
2022-01-02 21:56:14 +02:00
namespace West.Entertainment.Handler.Fun
{
public class Python : AbstractAnimationReply
{
protected override Regex AnimationMatch =>
new("питон|пайтон|python|путхон|питухон|петухон",
RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
2022-01-02 21:56:14 +02:00
2022-01-03 14:58:53 +02:00
protected override string GetAnimationName()
=> "python";
2023-07-29 01:50:28 +03:00
[InChat(InChat.Public)]
[Command("setpython", CommandParseMode.Both)]
2022-01-03 14:58:53 +02:00
public async Task HandleSetPython()
=> await HandleSetAnimation();
2023-07-29 01:50:28 +03:00
[InChat(InChat.Public)]
[Message(MessageFlag.HasText)]
public async Task HandlePython()
{
await HandleAnimation();
}
2022-01-03 14:58:53 +02:00
public Python(CoreContext db, ILogger<Python> logger, ThreadSafeRandom rng) : base(db, logger, rng) { }
2022-01-02 21:56:14 +02:00
}
}