Updated readmes
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user