Updated readmes

This commit is contained in:
2026-03-07 20:53:41 +04:00
parent a3fd6a6007
commit 7df9e1e952
2 changed files with 62 additions and 1 deletions
+33 -1
View File
@@ -41,7 +41,7 @@ using Telegrator.Hosting.Web;
TelegramBotWebHostBuilder builder = TelegramBotWebHost.CreateBuilder(new WebApplicationOptions()
{
Args = args,
ApplicationName = "Telegrator WebApplication example",
ApplicationName = "TelegramBotWebHost example",
});
// Register handlers
@@ -58,6 +58,38 @@ telegramBot.Run();
---
## Application integration Example
**Program.cs (ASP.NET Core):**
```csharp
using Telegrator.Hosting;
using Telegrator.Hosting.Web;
// Creating builder
WebApplicationBuilder builder = WebApplication.CreateBuilder(new WebApplicationOptions()
{
Args = args,
ApplicationName = "WebApplication example",
});
// Adding Telegrator
builder.AddTelegratorWeb();
// Register handlers
builder.Handlers.CollectHandlersAssemblyWide();
// Register your services
builder.Services.AddSingleton<IMyService, MyService>();
// Building and running application
builder.Build()
.UseTelegratorWeb()
.SetBotCommands();
.Run();
```
---
## Configuration (appsettings.json)
```json