Telegrator.Hosting 1.18.6.2

dotnet add package Telegrator.Hosting --version 1.18.6.2
                    
NuGet\Install-Package Telegrator.Hosting -Version 1.18.6.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="1.18.6.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Telegrator.Hosting" Version="1.18.6.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 1.18.6.2
                    
#r "nuget: Telegrator.Hosting, 1.18.6.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@1.18.6.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=1.18.6.2
                    
Install as a Cake Addin
#tool nuget:?package=Telegrator.Hosting&version=1.18.6.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
1.18.6.2 0 6/12/2026
1.18.6.1 0 6/12/2026
1.18.6 0 6/12/2026
1.18.5.2 112 6/7/2026
1.18.5.1 136 6/3/2026
1.18.5 120 6/2/2026
1.18.4.3 112 6/2/2026
1.18.4.2 125 6/2/2026
1.18.4.1 115 6/2/2026
1.18.4 112 6/1/2026
1.18.3 124 5/28/2026
1.18.2 119 5/26/2026
1.18.1 115 5/25/2026
1.18.0 119 5/24/2026
1.17.3 122 5/22/2026
1.17.1 121 5/1/2026
1.17.0 117 4/27/2026
1.16.9 110 4/23/2026
1.16.8 138 4/3/2026
1.16.7 124 3/15/2026
Loading failed