Use file-scoped namespaces

This commit is contained in:
Andriy
2023-07-29 15:14:52 +03:00
parent a24332370d
commit 8ab067a027
58 changed files with 2222 additions and 2280 deletions
+32 -33
View File
@@ -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;
}