Telegram.BotKit 1.3.0

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

Telegram.BotKit 🤖

NuGet

A structured, extensible .NET Framework for building Telegram bots.

Built on top of the popular Telegram.Bot library, adopting ASP.NET Core principles: strong typing, Dependency Injection, and a Middleware Pipeline.

💡 Motivation

This project was born out of a desire to eliminate boilerplate code. Starting a new bot often meant copying the same logic over and over: string parsing, command switch-cases, and webhook configuration.

Telegram.BotKit handles this "grunt work," providing a convenient pipeline, DI, and strongly-typed parameters, allowing you to focus purely on business logic.

🏗 Architecture

The framework follows a Handler-based approach. Message processing flows through a configurable pipeline:

graph TD
    Update[Telegram Update] --> Handler{Update Handler}
    
    %% Command Flow
    Handler -- "Message starts with / (default)" --> CmdDisp[Command Dispatcher]
    CmdDisp --> CmdPipe[Pipeline: ErrorHandler -> User Middlewares]
    CmdPipe --> CmdRouter[Router]
    CmdRouter -- Reflection & Binder --> CmdInvoker[Invoker]
    CmdInvoker --> CmdHandler[ICommandHandler]
    
    %% Callback Flow
    Handler -- Callback Query --> CbkDisp[Callback Dispatcher]
    CbkDisp --> CbkPipe[Pipeline: ErrorHandler -> User Middlewares]
    CbkPipe --> CbkRouter[Router]
    CbkRouter -- JSON/Url Binder --> CbkInvoker[Invoker]
    CbkInvoker --> CbkHandler[ICallbackHandler]

✨ Features

  • Smart Binding: Automatically maps text like /duel rps 5 into a typed object class { Game="rps", Wins=5 }. Supports quotes (key="val") and named arguments.
  • Hybrid Hosting: Supports both Long Polling (Console) and Webhooks (ASP.NET Core) out of the box — switch modes with a single line in the config.
  • Middleware: Global error handling, logging, and custom logic layers.
  • Clear Structure: Clean separation of logic for Commands and Inline Callbacks.

📦 Installation & Example

A complete usage example with source code can be found in the 📂 Telegram.BotKit.Example directory.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 132 2/9/2026
1.2.0 134 1/27/2026
1.1.0 126 1/25/2026
1.0.3 121 1/21/2026
1.0.2 139 1/16/2026
1.0.1 119 1/13/2026