mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Use file-scoped namespaces
This commit is contained in:
@@ -10,42 +10,41 @@ using Kruzya.TelegramBot.Core.Data;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Telegram.Bot;
|
||||
|
||||
namespace West.Entertainment.Handler.Fun
|
||||
namespace West.Entertainment.Handler.Fun;
|
||||
|
||||
public class Bayan : AbstractAnimationReply
|
||||
{
|
||||
public class Bayan : AbstractAnimationReply
|
||||
protected override TimeSpan Cooldown => TimeSpan.Zero;
|
||||
|
||||
public Bayan(CoreContext db, ILogger<Bayan> logger, ThreadSafeRandom rng) : base(db, logger, rng) { }
|
||||
|
||||
protected override Regex AnimationMatch
|
||||
=> new("^баян$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
|
||||
protected override string GetAnimationName()
|
||||
=> "bayan";
|
||||
|
||||
[InChat(InChat.Public)]
|
||||
[Command("setbayan", CommandParseMode.Both)]
|
||||
public async Task HandleSetBayan()
|
||||
=> await HandleSetAnimation();
|
||||
|
||||
[InChat(InChat.Public)]
|
||||
[Message(MessageFlag.HasText)]
|
||||
public async Task HandleBayan()
|
||||
{
|
||||
protected override TimeSpan Cooldown => TimeSpan.Zero;
|
||||
|
||||
public Bayan(CoreContext db, ILogger<Bayan> logger, ThreadSafeRandom rng) : base(db, logger, rng) { }
|
||||
|
||||
protected override Regex AnimationMatch
|
||||
=> new("^баян$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
|
||||
protected override string GetAnimationName()
|
||||
=> "bayan";
|
||||
|
||||
[InChat(InChat.Public)]
|
||||
[Command("setbayan", CommandParseMode.Both)]
|
||||
public async Task HandleSetBayan()
|
||||
=> await HandleSetAnimation();
|
||||
|
||||
[InChat(InChat.Public)]
|
||||
[Message(MessageFlag.HasText)]
|
||||
public async Task HandleBayan()
|
||||
if (await HandleAnimation())
|
||||
{
|
||||
if (await HandleAnimation())
|
||||
{
|
||||
await Bot.DeleteMessageAsync(Chat.Id, Message!.MessageId);
|
||||
}
|
||||
await Bot.DeleteMessageAsync(Chat.Id, Message!.MessageId);
|
||||
}
|
||||
|
||||
protected override int? GetMessageIdToReply()
|
||||
{
|
||||
return Message!.ReplyToMessage!.MessageId;
|
||||
}
|
||||
|
||||
protected override bool CanHandle()
|
||||
=> Message?.ReplyToMessage != null;
|
||||
|
||||
}
|
||||
|
||||
protected override int? GetMessageIdToReply()
|
||||
{
|
||||
return Message!.ReplyToMessage!.MessageId;
|
||||
}
|
||||
|
||||
protected override bool CanHandle()
|
||||
=> Message?.ReplyToMessage != null;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user