Telegrator.Hosting 18.7.2

dotnet add package Telegrator.Hosting --version 18.7.2
                    
NuGet\Install-Package Telegrator.Hosting -Version 18.7.2
                    
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="18.7.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Telegrator.Hosting" Version="18.7.2" />
                    
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 18.7.2
                    
#r "nuget: Telegrator.Hosting, 18.7.2"
                    
#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@18.7.2
                    
#: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=18.7.2
                    
Install as a Cake Addin
#tool nuget:?package=Telegrator.Hosting&version=18.7.2
                    
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 (via CollectHandlers source generator)
  • 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

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()
    .WithPolling()
    .Handlers.CollectHandlers();

// Building and running application
builder.Build()
    .UseTelegrator()
    .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

MIT

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 (3)

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

Package Downloads
Telegrator.Hosting.Web

Package Description

Telegrator.Hosting.WideBot

Package Description

Telegrator.Testing

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
18.7.2 126 6/17/2026
18.7.1 133 6/17/2026
18.7.0 134 6/15/2026
1.18.6.2 129 6/12/2026
1.18.6.1 123 6/12/2026
1.18.6 117 6/12/2026
1.18.5.2 127 6/7/2026
1.18.5.1 138 6/3/2026
1.18.5 125 6/2/2026
1.18.4.3 116 6/2/2026
1.18.4.2 127 6/2/2026
1.18.4.1 119 6/2/2026
1.18.4 115 6/1/2026
1.18.3 127 5/28/2026
1.18.2 121 5/26/2026
1.18.1 117 5/25/2026
1.18.0 121 5/24/2026
1.17.3 123 5/22/2026
1.17.1 122 5/1/2026
1.17.0 120 4/27/2026
Loading failed