2022-01-02 21:56:14 +02:00
|
|
|
#nullable enable
|
|
|
|
|
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using BotFramework.Attributes;
|
|
|
|
|
using BotFramework.Enums;
|
2023-01-17 23:13:06 +02:00
|
|
|
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 =>
|
2022-01-03 15:17:11 +02:00
|
|
|
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";
|
2022-01-02 21:56:14 +02:00
|
|
|
|
|
|
|
|
[Command(InChat.Public, "setpython", CommandParseMode.Both)]
|
2022-01-03 14:58:53 +02:00
|
|
|
public async Task HandleSetPython()
|
|
|
|
|
=> await HandleSetAnimation();
|
|
|
|
|
|
|
|
|
|
[Message(InChat.Public, MessageFlag.HasText)]
|
2022-01-03 22:14:59 +02:00
|
|
|
public async Task HandlePython()
|
|
|
|
|
{
|
|
|
|
|
await HandleAnimation();
|
|
|
|
|
}
|
2022-01-03 14:58:53 +02:00
|
|
|
|
2023-01-17 23:13:06 +02:00
|
|
|
public Python(CoreContext db, ILogger<Python> logger, ThreadSafeRandom rng) : base(db, logger, rng) { }
|
2022-01-02 21:56:14 +02:00
|
|
|
}
|
|
|
|
|
}
|