Files

35 lines
1.0 KiB
C#
Raw Permalink 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
2023-07-29 15:14:52 +03:00
namespace West.Entertainment.Handler.Fun;
2022-01-02 21:56:14 +02:00
2023-07-29 15:14:52 +03:00
public class Python : AbstractAnimationReply
{
protected override Regex AnimationMatch =>
new("питон|пайтон|python|путхон|питухон|петухон",
RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
2023-07-29 01:50:28 +03:00
2023-07-29 15:14:52 +03:00
protected override string GetAnimationName()
=> "python";
2022-01-03 14:58:53 +02:00
2023-07-29 15:14:52 +03:00
[InChat(InChat.Public)]
[Command("setpython", CommandParseMode.Both)]
public async Task HandleSetPython()
=> await HandleSetAnimation();
2022-01-03 14:58:53 +02:00
2023-07-29 15:14:52 +03:00
[InChat(InChat.Public)]
[Message(MessageFlag.HasText)]
public async Task HandlePython()
{
await HandleAnimation();
2022-01-02 21:56:14 +02:00
}
2023-07-29 15:14:52 +03:00
public Python(CoreContext db, ILogger<Python> logger, ThreadSafeRandom rng) : base(db, logger, rng) { }
2022-01-02 21:56:14 +02:00
}