IWF.TeleFlow.Annotations 1.0.0-alpha.2

This is a prerelease version of IWF.TeleFlow.Annotations.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package IWF.TeleFlow.Annotations --version 1.0.0-alpha.2
                    
NuGet\Install-Package IWF.TeleFlow.Annotations -Version 1.0.0-alpha.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="IWF.TeleFlow.Annotations" Version="1.0.0-alpha.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IWF.TeleFlow.Annotations" Version="1.0.0-alpha.2" />
                    
Directory.Packages.props
<PackageReference Include="IWF.TeleFlow.Annotations" />
                    
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 IWF.TeleFlow.Annotations --version 1.0.0-alpha.2
                    
#r "nuget: IWF.TeleFlow.Annotations, 1.0.0-alpha.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 IWF.TeleFlow.Annotations@1.0.0-alpha.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=IWF.TeleFlow.Annotations&version=1.0.0-alpha.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=IWF.TeleFlow.Annotations&version=1.0.0-alpha.2&prerelease
                    
Install as a Cake Tool

TeleFlow

CI CodeQL Telegram Bot API NuGet Downloads Telegram Chat License .NET

TeleFlow is an explicit Telegram bot framework for .NET.

It is built for the normal lifecycle of a Telegram bot: a first command, then callbacks, state, role checks, background services, retries, storage, diagnostics, deployment, and a codebase that still needs to be readable after it grows.

Starts like a script. Grows like a system.

Documentation

The repository documentation is split like a small product site and is ready to be moved to GitHub Pages later.

Community

What TeleFlow Gives You

  • Handler routing with attributes such as [Command], [Text], [Callback], [State], [SceneStep], and media filters.
  • Build-time generated handler metadata through the IWF.TeleFlow.Generators package.
  • A deliberate failure when generated metadata is missing. No silent reflection fallback on the recommended path.
  • Direct Telegram Bot API access through ITelegramClient and generated ctx.Bot.*Async extension methods.
  • Message and callback helpers for common flows: answers, replies, edits, deletion, media, keyboards, and chat actions.
  • Typed callback payloads with compact callback data serialization.
  • State, state data, wizard navigation, and replaceable storage contracts.
  • Long polling and ASP.NET Core webhook framework adapters.
  • Raw long polling and raw webhook packages for applications that do not want the handler framework.
  • Normal .NET dependency injection for handlers, services, repositories, filters, storage, and infrastructure.

Install

TeleFlow is currently published as a public alpha. Use --prerelease or pin an exact alpha version.

For a handler-based long polling bot:

dotnet add package IWF.TeleFlow.Telegram.Framework.LongPolling --prerelease
dotnet add package IWF.TeleFlow.Generators --prerelease
dotnet add package IWF.TeleFlow.Storage.Memory --prerelease

Keep the generator as a private build-time dependency:

<PackageReference Include="IWF.TeleFlow.Generators" Version="..." PrivateAssets="all" />

For direct Bot API access without the framework:

dotnet add package IWF.TeleFlow.Telegram --prerelease

First Bot

Create a console app, install the packages above, and set TELEFLOW_BOT_TOKEN:

export TELEFLOW_BOT_TOKEN=123456:token

PowerShell:

$env:TELEFLOW_BOT_TOKEN = "123456:token"

Replace Program.cs with this:

using TeleFlow.Annotations;
using TeleFlow.Core.Application;
using TeleFlow.Storage.Memory;
using TeleFlow.Telegram;

var token = Environment.GetEnvironmentVariable("TELEFLOW_BOT_TOKEN")
    ?? throw new InvalidOperationException("TELEFLOW_BOT_TOKEN is not set.");

var builder = TeleFlowApplication.CreateBuilder(args);

builder.Services.AddTelegramBot(options => options.Token = token);
builder.Services.AddMemoryStateStorage();
builder.Services.AddTelegramHandlersFromAssembly(typeof(Program).Assembly);
builder.Services.AddLongPolling();

await using var app = builder.Build();
await app.RunAsync();

public sealed class StartHandler
{
    [Command("start")]
    public Task Handle(MessageContext ctx, CancellationToken ct)
    {
        return ctx.Message.AnswerAsync("Hello from TeleFlow.", ct);
    }
}

This example uses generated assembly registration. If the IWF.TeleFlow.Generators package is not referenced by the application project, AddTelegramHandlersFromAssembly(...) fails during startup with a clear configuration error.

If you are new to bot frameworks, read:

  1. Quickstart
  2. Configuration and secrets
  3. Recommended paths
  4. Handlers and routing
  5. Callbacks and keyboards
  6. State and wizard

If you already build production .NET services, read:

  1. Packages
  2. Configuration and secrets
  3. Application model
  4. Project structure
  5. Dependency injection
  6. Transports
  7. Deployment
  8. Performance and scaling
  9. Versioning and releases
  10. Enterprise guide

Project Status

TeleFlow is in active development. The documentation describes APIs that exist in the current repository. Planned features belong in roadmap documents, not in user-facing API documentation.

Planned framework work is tracked in the roadmap.

Runtime packages currently target net10.0. The IWF.TeleFlow.Generators package targets netstandard2.0 because analyzers and source generators run inside the compiler.

Benchmarks

The repository includes an isolated BenchmarkDotNet project for no-network runtime measurements:

Benchmark dependencies are intentionally kept outside TeleFlow.sln and do not affect normal library builds or package graphs.

License

TeleFlow is released under the MIT License.

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.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on IWF.TeleFlow.Annotations:

Package Downloads
IWF.TeleFlow.Framework

Dependency package with the advanced TeleFlow Telegram handler framework runtime. Most applications should install IWF.TeleFlow.Framework.LongPolling or IWF.TeleFlow.Framework.Webhooks instead.

IWF.TeleFlow.Telegram.Framework

Attribute-based Telegram bot framework runtime for TeleFlow, including contexts, dispatcher, filters, callbacks, state integration, and generated handler registration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.14 20 8/5/2026
1.0.0-alpha.13 65 7/31/2026
1.0.0-alpha.12 81 7/21/2026
1.0.0-alpha.11 67 7/21/2026
1.0.0-alpha.10 65 7/21/2026
1.0.0-alpha.9 121 7/2/2026
1.0.0-alpha.8 81 7/1/2026
1.0.0-alpha.7 78 7/1/2026
1.0.0-alpha.6 87 7/1/2026
1.0.0-alpha.5 79 6/30/2026
1.0.0-alpha.4 74 6/29/2026
1.0.0-alpha.3 72 6/27/2026
1.0.0-alpha.2 72 6/26/2026
0.1.0-alpha.1 80 6/25/2026