Telegrator 1.18.5.2
dotnet add package Telegrator --version 1.18.5.2
NuGet\Install-Package Telegrator -Version 1.18.5.2
<PackageReference Include="Telegrator" Version="1.18.5.2" />
<PackageVersion Include="Telegrator" Version="1.18.5.2" />
<PackageReference Include="Telegrator" />
paket add Telegrator --version 1.18.5.2
#r "nuget: Telegrator, 1.18.5.2"
#:package Telegrator@1.18.5.2
#addin nuget:?package=Telegrator&version=1.18.5.2
#tool nuget:?package=Telegrator&version=1.18.5.2
Telegrator (Core)
The heart of the Telegrator framework. Provides the mediator-based update routing system, aspect-oriented handlers, declarative filters, state management, and the awaiting mechanism.
📦 What's Inside
Handlers
Independent, aspect-oriented modules that process Telegram updates. Each handler is a class that inherits from a base handler type (e.g., MessageHandler, CommandHandler, CallbackQueryHandler) and overrides the Execute method.
[MessageHandler]
[TextContains("hello")]
public class HelloHandler : MessageHandler
{
public override async Task<Result> Execute(IHandlerContainer<Message> container, CancellationToken cancellation)
{
await Reply($"Hello, {container.ActualUpdate.From?.FirstName}!");
return Ok;
}
}
Filters
Declarative conditions that determine whether a handler should process an update. Filters are defined as attributes and evaluated by the mediator before handler execution.
Built-in filters include:
TextContains,TextStartsWith,TextEndsWithCommandAlliasChatTypeCallbackData,CallbackDataStartsWith- Regex-based filters
- Custom filters via
Filter<T>.If(...)
Routing & Mediation
The UpdateRouter dispatches incoming updates to appropriate handlers. It supports:
- Awaiting handlers — temporary handlers that wait for a specific follow-up update
- Regular handlers — persistent handlers registered at startup
- Exclusive awaiting routing — option to block regular handlers when awaiting handlers are active
- Bounded channel backpressure —
UpdateHandlersPoolusesChannel.CreateBoundedwith configurable capacity
Result Pattern
Handlers return a lightweight readonly record struct Result to control routing:
Result.Ok()— handler succeeded, stop routingResult.Fault()— handler failed, stop routingResult.Next()— handler skipped, continue to next handlerResult.Next<T>()— route to a specific handler type
State Management
Store and retrieve user/chat state without manual state machines.
await StateStorage.GetStateMachine<SetupWizard>(HandlingUpdate).BySenderId().Advance(cancellation);
Awaiting Mechanism
Pause handler execution and wait for the user's next message inline.
await Reply("What is your name?");
var nextMessage = await AwaitingProvider.AwaitMessage(HandlingUpdate).BySenderId(cancellation);
await Reply($"Hello, {nextMessage.Text}!");
OpenTelemetry Integration
Automatic ActivitySource spans for:
Telegrator.UpdateRouter—HandleUpdatespan withupdate.idandupdate.typetagsTelegrator.UpdateHandlersPool—ProcessHandlerspan with handler and update tags
🔧 Configuration
var options = new TelegratorOptions
{
Token = "<YOUR_BOT_TOKEN>",
MaximumParallelWorkingHandlers = 10, // Bounded channel capacity = 20
ExclusiveAwaitingHandlerRouting = false
};
var bot = new TelegratorClient(options);
🔗 Related Packages
| Package | Purpose |
|---|---|
Telegrator.Hosting |
.NET Generic Host integration |
Telegrator.Hosting.Web |
ASP.NET Core webhook support |
Telegrator.Analyzers |
Source generators for AOT |
Telegrator.Testing |
Unit & integration test utilities |
License
MIT
| Product | Versions 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 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.8)
- System.Diagnostics.DiagnosticSource (>= 10.0.8)
- System.Threading.Channels (>= 10.0.8)
- Telegram.Bot (>= 22.10.0.1)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Telegrator:
| Package | Downloads |
|---|---|
|
Telegrator.Hosting
Package Description |
|
|
Telegrator.RedisStateStorage
Package Description |
|
|
Telegartor.RedisStateStorage
Package Description |
|
|
Telegrator.Localized
Package Description |
|
|
Telegrator.Testing
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.18.5.2 | 149 | 6/7/2026 |
| 1.18.5.1 | 177 | 6/3/2026 |
| 1.18.5 | 175 | 6/2/2026 |
| 1.18.4.3 | 158 | 6/2/2026 |
| 1.18.4.2 | 155 | 6/2/2026 |
| 1.18.4.1 | 165 | 6/2/2026 |
| 1.18.4 | 167 | 6/1/2026 |
| 1.18.3 | 169 | 5/28/2026 |
| 1.18.2 | 168 | 5/26/2026 |
| 1.18.1 | 165 | 5/25/2026 |
| 1.18.0 | 209 | 5/24/2026 |
| 1.17.3.1 | 98 | 5/22/2026 |
| 1.17.3 | 209 | 5/22/2026 |
| 1.17.1 | 130 | 5/1/2026 |
| 1.17.0 | 127 | 4/27/2026 |
| 1.16.9 | 123 | 4/23/2026 |
| 1.16.8 | 146 | 4/3/2026 |
| 1.16.7 | 145 | 3/15/2026 |
| 1.16.6 | 178 | 3/15/2026 |
| 1.16.5 | 167 | 3/9/2026 |