Updated readmes

This commit is contained in:
2026-03-07 20:46:04 +04:00
parent 6c3253107a
commit a3fd6a6007
7 changed files with 103 additions and 30 deletions
+6 -5
View File
@@ -15,7 +15,7 @@
---
## Requirements
- .NET 8.0 or later
- .NET 10.0 or later
- [Telegrator](https://github.com/Rikitav/Telegrator)
---
@@ -35,10 +35,10 @@ dotnet add package Telegrator.Hosting
using Telegrator.Hosting;
// Creating builder
TelegramBotHostBuilder builder = TelegramBotHost.CreateBuilder(new TelegramBotHostBuilderSettings()
TelegramBotHostBuilder builder = TelegramBotHost.CreateBuilder(new HostApplicationBuilderSettings()
{
Args = args,
ExceptIntersectingCommandAliases = true
ApplicationName = "TelegramBotHost example",
});
// Registerring handlers
@@ -59,8 +59,9 @@ telegramBot.Run();
```json
{
"TelegramBotClientOptions": {
"Token": "YOUR_BOT_TOKEN"
"TelegratorOptions": {
"Token": "YOUR_BOT_TOKEN",
"ExceptIntersectingCommandAliases": true
},
"HostOptions": {
+1 -4
View File
@@ -48,11 +48,8 @@ public static class HostBuilderExtensions
/// <summary>
/// Replaces TelegramBotWebHostBuilder. Configures DI, options, and handlers.
/// </summary>
public static IHostApplicationBuilder AddTelegrator(this IHostApplicationBuilder builder, HostApplicationBuilderSettings settings, TelegratorOptions? options = null, IHandlersCollection? handlers = null)
public static IHostApplicationBuilder AddTelegrator(this IHostApplicationBuilder builder, TelegratorOptions? options = null, IHandlersCollection? handlers = null)
{
if (settings is null)
throw new ArgumentNullException(nameof(settings));
IServiceCollection services = builder.Services;
IConfigurationManager configuration = builder.Configuration;