Telegrator.Hosting 1.17.1

dotnet add package Telegrator.Hosting --version 1.17.1
                    
NuGet\Install-Package Telegrator.Hosting -Version 1.17.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Telegrator.Hosting" Version="1.17.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Telegrator.Hosting" Version="1.17.1" />
                    
Directory.Packages.props
<PackageReference Include="Telegrator.Hosting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Telegrator.Hosting --version 1.17.1
                    
#r "nuget: Telegrator.Hosting, 1.17.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Telegrator.Hosting@1.17.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Telegrator.Hosting&version=1.17.1
                    
Install as a Cake Addin
#tool nuget:?package=Telegrator.Hosting&version=1.17.1
                    
Install as a Cake Tool

Telegrator.Hosting

Telegrator.Hosting is an extension for the Telegrator framework that provides seamless integration with the .NET Generic Host, enabling production-ready, scalable, and maintainable Telegram bot applications.


Features

  • Integration with Microsoft.Extensions.Hosting (background services, DI, configuration, logging)
  • Automatic handler discovery and registration
  • Strongly-typed configuration via appsettings.json and environment variables
  • Graceful startup/shutdown and lifecycle management
  • Advanced error handling and logging
  • Supports all Telegrator handler/filter/state features

Requirements


Installation

dotnet add package Telegrator.Hosting

Quick Start Example

Program.cs:

using Telegrator.Hosting;

// Creating builder
TelegramBotHostBuilder builder = TelegramBotHost.CreateBuilder(new HostApplicationBuilderSettings()
{
    Args = args,
    ApplicationName = "TelegramBotHost example",
});

// Registerring handlers
builder.Handlers.CollectHandlersAssemblyWide();

// Register your services
builder.Services.AddSingleton<IMyService, MyService>();

// Building and running application
TelegramBotHost telegramBot = builder.Build();
telegramBot.SetBotCommands();
telegramBot.Run();

Application integration Example

Program.cs:

using Telegrator.Hosting;

// Creating builder
HostApplicationBuilder builder = Host.CreateApplicationBuilder(new HostApplicationBuilderSettings()
{
    Args = args,
    ApplicationName = "Host example",
});

// Adding Telegrator
builder.AddTelegrator();

// Registerring handlers (extension)
builder.Handlers.CollectHandlersAssemblyWide();

// Building and running application
builder.Build()
    .UseTelegrator()
    .SetBotCommands()
    .Run();


Configuration (appsettings.json)

{
  "TelegratorOptions": {
    "Token": "YOUR_BOT_TOKEN",
    "ExceptIntersectingCommandAliases": true
  },

  "HostOptions": {
    "ShutdownTimeout": 10,
    "BackgroundServiceExceptionBehavior": "StopHost"
  },

  "ReceiverOptions": {
    "DropPendingUpdates": true,
    "Limit": 10
  }
}
  • TelegramBotClientOptions: Bot token and client settings
  • HostOptions: Host lifecycle and shutdown behavior
  • ReceiverOptions: Long-polling configuration

Documentation


License

GPLv3

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Telegrator.Hosting:

Package Downloads
Telegrator.Hosting.Web

Package Description

Telegrator.Hosting.WideBot

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.17.1 103 5/1/2026
1.17.0 106 4/27/2026
1.16.9 100 4/23/2026
1.16.8 125 4/3/2026
1.16.7 115 3/15/2026
1.16.6 111 3/15/2026
1.16.5 108 3/9/2026
1.16.4 97 3/9/2026
1.16.3 109 3/8/2026
1.16.1 108 3/7/2026
1.16.0 104 3/7/2026
1.15.9 321 8/24/2025
1.15.8 287 8/24/2025
1.15.7 150 8/23/2025
1.15.6 219 8/21/2025
1.15.5 219 8/19/2025
1.15.4 209 8/19/2025
1.15.3 221 8/19/2025
1.15.2 269 8/18/2025
1.15.1 200 8/18/2025
Loading failed