Update dependencies

This commit is contained in:
Sergey Nazarov 2024-03-30 12:08:12 +03:00
parent 0e7c60e3a7
commit 53bda5b83f
4 changed files with 10 additions and 5 deletions

View File

@ -6,7 +6,7 @@
<MicrosoftVersion>8.0.0</MicrosoftVersion>
</PropertyGroup>
<ItemGroup Label="Nocr">
<PackageVersion Include="Nocr.TextMatcher.Async.Api.Contracts" Version="0.4.22" />
<PackageVersion Include="Nocr.TextMatcher.Async.Api.Contracts" Version="0.4.25" />
</ItemGroup>
<ItemGroup Label="Telegram">
<PackageVersion Include="WTelegramClient" Version="3.7.1" />

View File

@ -18,7 +18,7 @@ public static class ServiceCollectionExtensions
services.Configure<WTelegramClientOptions>(configuration.GetSection(nameof(WTelegramClientOptions)));
services.AddHostedService<UpdateListenerBackgroundService>();
services.AddRebusHandler<TextMatchCreatedHandler>();
services.AddRebusHandler<TextSubscriptionCreatedHandler>();
services.AddScoped<IUpdateHandler, UpdateHandler>();
services.AddScoped<INewMessageHandler, NewMessageHandler>();

View File

@ -5,19 +5,19 @@ using TL;
namespace Nocr.TelegramListener.AppServices.TextMatches;
public class TextMatchCreatedHandler : IHandleMessages<TextMatchCreated>
public class TextSubscriptionCreatedHandler : IHandleMessages<TextSubscriptionCreated>
{
private readonly TelegramRegistry _telegramRegistry;
private readonly ITelegramClientContainer _clientContainer;
public TextMatchCreatedHandler(TelegramRegistry telegramRegistry,
public TextSubscriptionCreatedHandler(TelegramRegistry telegramRegistry,
ITelegramClientContainer clientContainer)
{
_telegramRegistry = telegramRegistry ?? throw new ArgumentNullException(nameof(telegramRegistry));
_clientContainer = clientContainer ?? throw new ArgumentNullException(nameof(clientContainer));
}
public async Task Handle(TextMatchCreated message)
public async Task Handle(TextSubscriptionCreated message)
{
var client = _clientContainer.Client;
var resolved = await client.Contacts_ResolveUsername(message.ChatUsername);

View File

@ -23,6 +23,11 @@
<Content Include="..\..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
<Content Include=".secrets\appsettings.protected.json">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
</Project>