TelegramBotBase 7.2.0

Prefix Reserved
dotnet add package TelegramBotBase --version 7.2.0
                    
NuGet\Install-Package TelegramBotBase -Version 7.2.0
                    
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="TelegramBotBase" Version="7.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TelegramBotBase" Version="7.2.0" />
                    
Directory.Packages.props
<PackageReference Include="TelegramBotBase" />
                    
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 TelegramBotBase --version 7.2.0
                    
#r "nuget: TelegramBotBase, 7.2.0"
                    
#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 TelegramBotBase@7.2.0
                    
#: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=TelegramBotBase&version=7.2.0
                    
Install as a Cake Addin
#tool nuget:?package=TelegramBotBase&version=7.2.0
                    
Install as a Cake Tool

Dependency Injection Refactoring

  • New FormDiEscort class (IAsyncDisposable) that bundles the IServiceScope and IFormFactory accompanying each form. (TelegramBotBase/DependencyInjection/FormDiEscort.cs)
  • Scoped service resolution: ServiceProviderFormFactory now creates a dedicated async service scope per form instead of passing the root IServiceProvider around. The scope is disposed together with the form. (TelegramBotBase/Factories/ServiceProviderFormFactory.cs)
  • Extension methods reworked: SetServiceProvider/GetServiceProvider were replaced by SetDiEscort/GetDiEscort; DI-based NavigateTo overloads now create new forms through the attached FormFactory. (TelegramBotBase/DependencyInjection/Extensions.cs)
  • FormBase is now IAsyncDisposable (previously IDisposable). DisposeAsync disposes the DI escort, and OnClosed now disposes the form automatically (also fixes an inverted null check in the event handler invocation). (TelegramBotBase/Base/FormBase.cs)
  • Typed factory results: CreateForm<T>() now returns T instead of FormBase in DefaultFormFactory, LambdaFormFactory, and ServiceProviderFormFactory.

Framework Fixes

  • ButtonGrid.Hidden now performs a Cleanup() when a modal is opened, so control state is rendered correctly after returning. (TelegramBotBase/Controls/Hybrid/ButtonGrid.cs)
  • PromptDialogCompletedEventArgs now derives from EventArgs. (TelegramBotBase/Args/PromptDialogCompletedEventArgs.cs)
  • Source generators: fixed chatId parameter ordering in TelegramDeviceExtensionGenerator and a loop bug in XmlDocumentationLoader; refreshed the bundled Telegram.Bot.xml documentation file. (TelegramBotBase.SourceGenerators/)

Examples

FileWatcher enhancements

  • Added a MessageBatcher that collects file event messages within a configurable time window and sends them as a single batch, reducing notification spam. (Examples/FileWatcher/MessageBatcher.cs)
  • Config now supports ServerName, BatchIntervalSeconds, and a %servername% placeholder in message templates; config loading is more robust and creates a default config file if none exists. (Examples/FileWatcher/Model/Config.cs, Examples/FileWatcher/Program.cs)
  • Unified the Created/Changed/Renamed handlers into a single file event handler using the batcher.

New ModalDialogNavigation example

Added a new example project (Examples/ModalDialogNavigation/) with a Start menu and four forms demonstrating dialog and navigation patterns:

  • Version1: modal PromptDialog without controls.
  • Version2: ButtonGrid control + modal prompt dialog, preserving control state.
  • Version3: ButtonGrid + non-modal prompt dialog (NavigateTo), demonstrating disposal and re-navigation from the dialog context.
  • Version4: demonstrates the illegal use of NavigateTo from a modal dialog context and handles the expected InvalidOperationException.

Test project

  • TelegramBotBase.Test now has an interactive console menu (open bot in browser / quit) and improvements to TestForm2 (callback data validation, back-to-menu button).

Dependency & Documentation Updates

  • Bumped Microsoft.SourceLink.GitHub, Microsoft.Data.SqlClient (6.1.4 → 7.0.1), Npgsql (8.0.8 → 9.0.5), IronSoftware.System.Drawing, and System.Drawing.Common across extension projects.
  • Dropped netcoreapp3.1 target from the PostgreSql serializer extension.
  • README: added notes on API key security, UploadBotCommands() usage, SimpleJSONStateMachine limitations, a thread-safety warning for .UseThreadPool(), an IronSoftware licensing note, a link to the new ModalDialogNavigation example, and removed a duplicated section.

⚠️ Potential Breaking Changes

  • FormBase changed from IDisposable to IAsyncDisposable (Dispose()DisposeAsync()).
  • SetServiceProvider/GetServiceProvider extension methods were replaced by SetDiEscort/GetDiEscort.
  • IFormFactory.CreateForm<T>() return type changed from FormBase to T.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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 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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on TelegramBotBase:

Package Downloads
TelegramBotBase.Extensions.Images

This is an extension for sending Bitmap/Images via TelegramBotBase.

TelegramBotBase.Extensions.Serializer.Database.PostgreSql

Serializer for postgre sql

TelegramBotBase.Extensions.Serializer.Database.MSSQL

base version to replace the Newtonsoft.Json serializer in the main package

TelegramBotBase.Extensions.ActionManager

This is a action manager extension to use with the C# TelegramBotBase library.

TelegramBotBase.Extensions.Images.IronSoftware

This is an extension for sending Bitmap/Images platform independent by using IronSoftware's drawing library via TelegramBotBase.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.2.0 103 8/4/2026
7.2.0-preview.3 57 7/26/2026
7.2.0-preview.2 80 4/13/2026
7.2.0-preview.1 71 4/8/2026
7.1.1 683 3/17/2026
7.1.0 409 1/8/2026
7.1.0-preview.1 244 11/16/2025
7.0.0 2,082 6/28/2025
7.0.0-preview.14 275 6/16/2025
7.0.0-preview.13 170 6/7/2025
7.0.0-preview.12 154 5/17/2025
7.0.0-preview.11 228 4/20/2025
7.0.0-preview.10 558 3/26/2025
7.0.0-preview.9 520 3/25/2025
7.0.0-preview.8 538 3/25/2025
7.0.0-preview.7 339 3/23/2025
7.0.0-preview.6 114 3/22/2025
7.0.0-preview.5 238 2/18/2025
6.6.3 495 6/7/2025
6.6.2 810 3/25/2025
Loading failed

- Dependency update. Removing .Net Framework target and replacing with .Net Standard 2.0