From 16b6215a31b08b2d41d6e842232a0e926c8e8db8 Mon Sep 17 00:00:00 2001 From: Rikitav Date: Sat, 7 Mar 2026 19:38:10 +0400 Subject: [PATCH] Fixed extensions conflict --- src/Telegrator.Hosting.Web/TypesExtensions.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Telegrator.Hosting.Web/TypesExtensions.cs b/src/Telegrator.Hosting.Web/TypesExtensions.cs index e5b95d5..77abd04 100644 --- a/src/Telegrator.Hosting.Web/TypesExtensions.cs +++ b/src/Telegrator.Hosting.Web/TypesExtensions.cs @@ -7,7 +7,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Telegram.Bot; using Telegrator.Core; -using Telegrator.Hosting; using Telegrator.Hosting.Web; using Telegrator.Mediation; using Telegrator.Providers; @@ -25,7 +24,7 @@ namespace Telegrator /// public const string HandlersCollectionPropertyKey = nameof(IHandlersCollection); - extension(IHostApplicationBuilder builder) + extension(WebApplicationBuilder builder) { /// /// Gets the from the builder properties. @@ -34,13 +33,7 @@ namespace Telegrator { get { - if (builder is TelegramBotHostBuilder botHostBuilder) - return botHostBuilder.Handlers; - - if (builder is TelegramBotWebHostBuilder webBotHostBuilder) - return webBotHostBuilder.Handlers; - - return (IHandlersCollection)builder.Properties[HandlersCollectionPropertyKey]; + return (IHandlersCollection)builder.Host.Properties[HandlersCollectionPropertyKey]; } } } @@ -67,7 +60,7 @@ namespace Telegrator options.GlobalCancellationToken = globallCancell.Token; services.AddSingleton(Options.Create(options)); services.AddKeyedSingleton("cancell", globallCancell); - +1 if (handlers != null) { if (handlers is IHandlersManager manager)