2024-08-28 23:49:09 +03:00
|
|
|
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 Golang : AbstractAnimationReply
|
|
|
|
|
{
|
|
|
|
|
public Golang(CoreContext db, ILogger<Golang> logger, ThreadSafeRandom rng) : base(db, logger, rng) { }
|
|
|
|
|
|
|
|
|
|
protected override Regex AnimationMatch =>
|
2024-10-06 22:34:14 +03:00
|
|
|
new(@"((?<![\w])(го|go)(?![\\w]))|golang|голанг|голенг|гошка|(\\*\\.go)",
|
2024-08-28 23:49:09 +03:00
|
|
|
RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
|
|
|
|
protected override string GetAnimationName() => "golang";
|
|
|
|
|
|
|
|
|
|
[InChat(InChat.Public)]
|
2024-10-06 22:34:14 +03:00
|
|
|
[Command("setgolang", CommandParseMode.Both)]
|
2024-08-28 23:49:09 +03:00
|
|
|
public async Task HandleSetGolang() => await HandleSetAnimation();
|
|
|
|
|
|
|
|
|
|
[InChat(InChat.Public)]
|
|
|
|
|
[Message(MessageFlag.HasText)]
|
|
|
|
|
public async Task HandleGolang() => await HandleAnimation();
|
|
|
|
|
}
|