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:
@@ -6,24 +6,23 @@ using BotFramework.Enums;
|
||||
using Kruzya.TelegramBot.Core.Data;
|
||||
using Kruzya.TelegramBot.Core.Extensions;
|
||||
|
||||
namespace Kruzya.TelegramBot.UrlLimitations
|
||||
{
|
||||
public class UserJoinHandler : BotEventHandler
|
||||
{
|
||||
protected readonly CoreContext dbCtx;
|
||||
|
||||
public UserJoinHandler(CoreContext coreContext)
|
||||
{
|
||||
dbCtx = coreContext;
|
||||
}
|
||||
namespace Kruzya.TelegramBot.UrlLimitations;
|
||||
|
||||
[InChat(InChat.Public)]
|
||||
[Message(MessageFlag.HasNewChatMembers)]
|
||||
public async Task OnChatMembersAdded()
|
||||
{
|
||||
foreach (var member in RawUpdate.Message.NewChatMembers)
|
||||
await dbCtx.UserValues.SetOptionValue<UInt16>(Chat.Id, member.Id, "urlLimitations.messagesAfterJoin",
|
||||
0);
|
||||
}
|
||||
public class UserJoinHandler : BotEventHandler
|
||||
{
|
||||
protected readonly CoreContext dbCtx;
|
||||
|
||||
public UserJoinHandler(CoreContext coreContext)
|
||||
{
|
||||
dbCtx = coreContext;
|
||||
}
|
||||
|
||||
[InChat(InChat.Public)]
|
||||
[Message(MessageFlag.HasNewChatMembers)]
|
||||
public async Task OnChatMembersAdded()
|
||||
{
|
||||
foreach (var member in RawUpdate.Message.NewChatMembers)
|
||||
await dbCtx.UserValues.SetOptionValue<UInt16>(Chat.Id, member.Id, "urlLimitations.messagesAfterJoin",
|
||||
0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user