Move fun commands to separate module.

This commit is contained in:
West14
2022-01-02 21:56:14 +02:00
parent d2077df114
commit 8d3e24295b
10 changed files with 126 additions and 93 deletions
@@ -0,0 +1,25 @@
#nullable enable
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BotFramework.Attributes;
using BotFramework.Enums;
using Kruzya.TelegramBot.Core.Data;
namespace West.Entertainment.Handler.Fun
{
public class Python : AbstractAnimationReply
{
protected override Regex AnimationMatch =>
new("питон|пайтон|python|путхон|питухон|петухон", RegexOptions.IgnoreCase);
protected override string GetAnimationName() => "python";
protected override bool CanHandle() => !Message!.Text!.Contains("/setpython");
[Command(InChat.Public, "setpython", CommandParseMode.Both)]
public async Task HandleSetPython() => await HandleSetAnimation();
public Python(CoreContext db) : base(db) { }
}
}