Telegrator.Hosting 1.15.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package Telegrator.Hosting --version 1.15.6
                    
NuGet\Install-Package Telegrator.Hosting -Version 1.15.6
                    
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.15.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Telegrator.Hosting" Version="1.15.6" />
                    
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.15.6
                    
#r "nuget: Telegrator.Hosting, 1.15.6"
                    
#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.15.6
                    
#: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.15.6
                    
Install as a Cake Addin
#tool nuget:?package=Telegrator.Hosting&version=1.15.6
                    
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 TelegramBotHostBuilderSettings()
{
    Args = args,
    ExceptIntersectingCommandAliases = true
});

// 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();

Configuration (appsettings.json)

{
  "TelegramBotClientOptions": {
    "Token": "YOUR_BOT_TOKEN"
  },

  "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 net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (1)

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

Package Downloads
Telegrator.Hosting.Web

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.15.9 214 8/24/2025
1.15.8 206 8/24/2025
1.15.7 72 8/23/2025
1.15.6 140 8/21/2025
1.15.5 138 8/19/2025
1.15.4 138 8/19/2025
1.15.3 146 8/19/2025
1.15.2 192 8/18/2025
1.15.1 137 8/18/2025
1.15.0 135 8/18/2025
1.0.13 141 8/11/2025
1.0.12 185 8/8/2025
1.0.11 126 8/4/2025
1.0.10 64 8/2/2025
1.0.9 39 8/1/2025
1.0.8.1 72 8/1/2025
1.0.8 76 8/1/2025
1.0.7 104 7/28/2025
1.0.6 113 7/28/2025
1.0.5 115 7/27/2025
1.0.4 123 7/27/2025
1.0.3 85 7/27/2025
1.0.2 183 7/26/2025
1.0.1 329 7/25/2025
1.0.0 461 7/24/2025