IWF.TeleFlow.Telegram.Schema 1.0.0-alpha.9

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

TeleFlow

.NET Telegram Bot API Telegram Chat Release

License CI CodeQL GitHub last commit Downloads

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 documentation is available as a GitHub Pages site and as Markdown in this repository.

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.
  • Optional Generic Host integration through IWF.TeleFlow.Framework.Hosting.
  • 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.

Most applications start from one scenario package. The lower-level packages are pulled in transitively and are documented separately for advanced use.

For a handler-based long polling bot:

dotnet add package IWF.TeleFlow.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

For a .NET worker that should run TeleFlow through Microsoft.Extensions.Hosting, also install:

dotnet add package IWF.TeleFlow.Framework.Hosting --prerelease

You normally do not install IWF.TeleFlow.Framework.Core, IWF.TeleFlow.Framework, IWF.TeleFlow.Telegram.Client, IWF.TeleFlow.Telegram.Schema, or IWF.TeleFlow.Annotations directly. They are dependency or advanced packages behind the recommended entry points above.

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.Telegram;
using TeleFlow.Annotations;
using TeleFlow.Framework.Application;

var token = "12345:BOT_TOKEN";
var builder = TeleFlowApplication.CreateBuilder(args);

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

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

public sealed class Handlers
{
    [Command("start")]
    public async Task Start(MessageContext ctx, CancellationToken ct)
    {
        await ctx.Message.AnswerAsync("Hello from TeleFlow", ct);
    }

    [CommandTemplate("get_from {fromDate:string} {toDate:string} {count:int?}")]
    public async Task GetFrom(
        MessageContext ctx,
        string fromDate,
        string toDate,
        int? count,
        CancellationToken ct)
    {
        await ctx.Message.AnswerAsync(
            $"Okay. Getting from {fromDate} to {toDate} with {count ?? 0}",
            ct);
    }
}

Bot example

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 (5)

Showing the top 5 NuGet packages that depend on IWF.TeleFlow.Telegram.Schema:

Package Downloads
IWF.TeleFlow.Telegram.Client

Dependency package with the low-level generated Telegram Bot API client runtime. Most applications should install IWF.TeleFlow.Telegram or a TeleFlow framework entry package instead.

IWF.TeleFlow.Telegram.Framework

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

IWF.TeleFlow.Telegram.LongPolling

Advanced TeleFlow raw transport package for Telegram getUpdates, safe offset advancement, and acknowledged update streaming without the handler framework.

IWF.TeleFlow.Telegram.Webhooks

Advanced TeleFlow raw transport package with ASP.NET Core webhook endpoint helpers for applications that want Telegram Update payloads without the handler framework.

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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.9 35 7/2/2026
1.0.0-alpha.8 55 7/1/2026
1.0.0-alpha.7 55 7/1/2026
1.0.0-alpha.6 62 7/1/2026
1.0.0-alpha.5 57 6/30/2026
1.0.0-alpha.4 70 6/29/2026
1.0.0-alpha.3 84 6/27/2026
1.0.0-alpha.2 88 6/26/2026
0.1.0-alpha.1 92 6/25/2026