Fix TextSubscriptionMatchedHandler name

This commit is contained in:
Sergey Nazarov 2024-04-17 23:48:54 +03:00
parent 5e99e802ec
commit 581492a1da
4 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@ using Insight.TelegramBot.Models;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Nocr.TelegramClient.AppServices.Bots; using Nocr.TelegramClient.AppServices.Bots;
using Nocr.TelegramClient.AppServices.Bots.MessageDispatcher; using Nocr.TelegramClient.AppServices.Bots.MessageDispatcher;
using Nocr.TelegramClient.AppServices.Matches; using Nocr.TelegramClient.AppServices.TextSubscriptions;
using Nocr.TextMatcher.Api.Contracts.TextMatches; using Nocr.TextMatcher.Api.Contracts.TextMatches;
using Nocr.TextMatcher.Api.Contracts.TextMatches.Dto; using Nocr.TextMatcher.Api.Contracts.TextMatches.Dto;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;

View File

@ -2,8 +2,8 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Nocr.TelegramClient.AppServices.Bots.MessageDispatcher; using Nocr.TelegramClient.AppServices.Bots.MessageDispatcher;
using Nocr.TelegramClient.AppServices.Matches.Handlers;
using Nocr.TelegramClient.AppServices.Options; using Nocr.TelegramClient.AppServices.Options;
using Nocr.TelegramClient.AppServices.TextSubscriptions.Handlers;
using Nocr.TelegramClient.AppServices.Users; using Nocr.TelegramClient.AppServices.Users;
using Nocr.TextMatcher.Api.Contracts.TextMatches; using Nocr.TextMatcher.Api.Contracts.TextMatches;
using Nocr.Users.Api.Contracts.Users; using Nocr.Users.Api.Contracts.Users;
@ -20,7 +20,7 @@ public static class ServiceCollectionExtensions
throw new ArgumentNullException(nameof(services)); throw new ArgumentNullException(nameof(services));
// Add registrations here // Add registrations here
services.AddRebusHandler<TextSubscriptionMatched>(); services.AddRebusHandler<TextSubscriptionMatchedHandler>();
services.AddHttpClient(); services.AddHttpClient();
services.Configure<UsersRestEaseOptions>(configuration.GetSection(nameof(UsersRestEaseOptions))); services.Configure<UsersRestEaseOptions>(configuration.GetSection(nameof(UsersRestEaseOptions)));

View File

@ -9,16 +9,16 @@ using Nocr.Users.Api.Contracts.Users;
using Rebus.Handlers; using Rebus.Handlers;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
namespace Nocr.TelegramClient.AppServices.Matches.Handlers; namespace Nocr.TelegramClient.AppServices.TextSubscriptions.Handlers;
public class TextSubscriptionMatched : IHandleMessages<TextMatcher.Async.Api.Contracts.TextSubscriptionMatched> public class TextSubscriptionMatchedHandler : IHandleMessages<TextMatcher.Async.Api.Contracts.TextSubscriptionMatched>
{ {
private readonly ILogger<TextSubscriptionMatched> _logger; private readonly ILogger<TextSubscriptionMatchedHandler> _logger;
private readonly ILocalizer _localizer; private readonly ILocalizer _localizer;
private readonly IMessageDispatcherQueue _messageDispatcherQueue; private readonly IMessageDispatcherQueue _messageDispatcherQueue;
private readonly IUsersService _usersService; private readonly IUsersService _usersService;
public TextSubscriptionMatched(ILogger<TextSubscriptionMatched> logger, ILocalizer localizer, public TextSubscriptionMatchedHandler(ILogger<TextSubscriptionMatchedHandler> logger, ILocalizer localizer,
IMessageDispatcherQueue messageDispatcherQueue, IUsersService usersService) IMessageDispatcherQueue messageDispatcherQueue, IUsersService usersService)
{ {
_logger = logger ?? throw new ArgumentNullException(nameof(logger)); _logger = logger ?? throw new ArgumentNullException(nameof(logger));
@ -51,7 +51,7 @@ public class TextSubscriptionMatched : IHandleMessages<TextMatcher.Async.Api.Con
var link = new PublicTelegramMessageLink(false, message.ChatUsername, message.MessageId); var link = new PublicTelegramMessageLink(false, message.ChatUsername, message.MessageId);
var fromUsername = string.IsNullOrWhiteSpace(message.From) ? "anonymous" : message.From; var fromUsername = string.IsNullOrWhiteSpace(message.From) ? "anonymous" : message.From;
var text = _localizer.Get(nameof(TextSubscriptionMatched), "Text") var text = _localizer.Get(nameof(TextSubscriptionMatchedHandler), "Text")
.FormatWith(new .FormatWith(new
{ {
SubscriptionRule = message.Rule.TextView(_localizer), SubscriptionRule = message.Rule.TextView(_localizer),

View File

@ -1,7 +1,7 @@
using Insight.Localizer; using Insight.Localizer;
using Nocr.TextMatcher.Contracts; using Nocr.TextMatcher.Contracts;
namespace Nocr.TelegramClient.AppServices.Matches; namespace Nocr.TelegramClient.AppServices.TextSubscriptions;
public static class TextSubscriptionRuleExtensions public static class TextSubscriptionRuleExtensions
{ {