2 Commits

Author SHA1 Message Date
Rikitav ba772f3f7c * Fixed wrong UseTelegrator method using in web host
* Fixed HostedUpdateWebhooker service discovery
2026-03-15 19:23:56 +04:00
Rikitav ee78703cd1 Update README.md 2026-03-15 17:56:05 +04:00
6 changed files with 11 additions and 5 deletions
+4
View File
@@ -8,6 +8,10 @@ Telegrator is a modern C# framework for building Telegram bots, inspired by AOP
---
The documentation may not be completely transparent, informative or even actual to latest version, so if you have any questions or problems, please write them in the [Telegram.Bot](https://t.me/joinchat/B35YY0QbLfd034CFnvCtCA) group. I am a member of this group and will notice you! If you have any suggestions or want to participate in building documentation, make push requests and open issues on this repository!
---
## ✨ Key Features
- **Aspect-oriented approach**: Handlers and filters are "aspects" of the bot, easily composable and extendable.
@@ -94,7 +94,7 @@ public class TelegramBotWebHostBuilder : ITelegramBotHostBuilder
public TelegramBotWebHost Build()
{
TelegramBotWebHost host = new TelegramBotWebHost(_innerBuilder);
host.UseTelegrator();
host.UseTelegratorWeb();
return host;
}
@@ -15,7 +15,7 @@
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<Title>Telegrator.Hosting.Web</Title>
<Version>1.16.6</Version>
<Version>1.16.7</Version>
<Authors>Rikitav Tim4ik</Authors>
<Company>Rikitav Tim4ik</Company>
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
@@ -126,7 +126,9 @@ namespace Telegrator
/// </summary>
public static T UseTelegratorWeb<T>(this T app) where T : IEndpointRouteBuilder, IHost
{
HostedUpdateWebhooker webhooker = app.ServiceProvider.GetRequiredService<HostedUpdateWebhooker>();
if (app.ServiceProvider.GetServices<IHostedService>().FirstOrDefault(s => s is HostedUpdateWebhooker) is not HostedUpdateWebhooker webhooker)
throw new InvalidOperationException("No service for type 'Telegrator.Mediation.HostedUpdateWebhooker' has been registered.");
ITelegramBotInfo info = app.ServiceProvider.GetRequiredService<ITelegramBotInfo>();
IHandlersCollection handlers = app.ServiceProvider.GetRequiredService<IHandlersCollection>();
ILoggerFactory loggerFactory = app.ServiceProvider.GetRequiredService<ILoggerFactory>();
@@ -15,7 +15,7 @@
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<Title>Telegrator.Hosting</Title>
<Version>1.16.6</Version>
<Version>1.16.7</Version>
<Authors>Rikitav Tim4ik</Authors>
<Company>Rikitav Tim4ik</Company>
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
+1 -1
View File
@@ -14,7 +14,7 @@
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<Title>Telegrator : Telegram.Bot mediator framework</Title>
<Version>1.16.6</Version>
<Version>1.16.7</Version>
<Authors>Rikitav Tim4ik</Authors>
<Company>Rikitav Tim4ik</Company>
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>