mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
27 lines
947 B
C#
27 lines
947 B
C#
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 =>
|
|
new("golang|go|го|голанг|голенг|гошка|(\\*\\.go)",
|
|
RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
|
protected override string GetAnimationName() => "golang";
|
|
|
|
[InChat(InChat.Public)]
|
|
[Command("setgolang")]
|
|
public async Task HandleSetGolang() => await HandleSetAnimation();
|
|
|
|
[InChat(InChat.Public)]
|
|
[Message(MessageFlag.HasText)]
|
|
public async Task HandleGolang() => await HandleAnimation();
|
|
} |