mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Add JavaScript GIF response. Change cooldown.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using BotFramework.Attributes;
|
||||
using BotFramework.Enums;
|
||||
using Kruzya.TelegramBot.Core.Data;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace West.Entertainment.Handler.Fun
|
||||
{
|
||||
public class JavaScript : AbstractAnimationReply
|
||||
{
|
||||
public JavaScript(CoreContext db, ILogger<JavaScript> logger) : base(db, logger) { }
|
||||
|
||||
protected override Regex AnimationMatch => new(
|
||||
"жс|js|жаваскрипт|javascript|жопаскрипт|жиес|жиэс|v8|nodejs",
|
||||
RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
|
||||
protected override string GetAnimationName() => "javascript";
|
||||
|
||||
[Command(InChat.Public, "setjs", CommandParseMode.Both)]
|
||||
public async Task HandleSetJs()
|
||||
=> await HandleSetAnimation();
|
||||
|
||||
[Message(InChat.Public, MessageFlag.HasText)]
|
||||
public override async Task<bool> HandleAnimation()
|
||||
=> await base.HandleAnimation();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user