ZiziBot.TelegramBot.Framework 226.5.9641.27947-beta

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

ZiziBot.TelegramBot

CI ZiziBot.TelegramBot.Framework

ZiziBot.TelegramBot is a bot framework designed to help with command-based bot development. Some samples can be found in the Sample project.

This framework supports both Polling and Webhook modes. You can specify the mode in appsettings.json using the EngineMode property.

Auto Mode

By default, EngineMode is set to Auto. This means that during local development, it runs using Polling, and after deployment, it automatically switches to Webhook mode. Simply fill in the required configuration in appsettings.json to get started.

Please note that this is a very early-stage project, so there are no guarantees against breaking changes in the future.

This project is inspired by VodemSharp/Allowed.Telegram.Bot.

Framework Architecture

All bot commands are inherited from the BotCommandController class. This class provides a Context property that allows you to access the current request and send a response. To better understand how to create a command, please refer to the sample project.

Structure

The solution (ZiziBot.TelegramBot.sln) contains two main projects:

  1. ZiziBot.TelegramBot.Framework: A .NET library that provides the core framework for building command-based Telegram bots. It targets net8.0, net9.0, and net10.0.
  2. ZiziBot.TelegramBot.Sample: A .NET web project that serves as a sample implementation of the framework. It references the framework project and runs on net10.0.

Dependencies

  • The Framework project uses JetBrains.Annotations, Scrutor, UUIDNext, and WTelegramBot.
  • The Sample project uses Microsoft.AspNetCore.OpenApi and Serilog.AspNetCore.

Initialization

The bot is initialized in the Program.cs file of the sample project. Here's a breakdown of the key steps:

  1. AddZiziBotTelegramBot(): This extension method registers all the necessary services for the bot to run.
  2. UseZiziBotTelegramBot(): This extension method configures the bot and starts the engine.

Adding a New Command

To add a new command, you can create a new class that inherits from BotCommandController and add methods with the [Command] attribute. For example:

public class SampleCommands : BotCommandController
{
    [Command("ping")]
    public async Task Ping()
    {
        await SendMessageText("Pong!");
    }
}

Build & Run

  • Build: The entire solution can be built using the dotnet build command from the root directory.
  • Run: The sample application can be run with the command dotnet run from the ZiziBot.TelegramBot.Sample directory.
  • URL: When running, the sample application is accessible at http://localhost:5157.

Demo project

  1. ZiziBot-Engine

Thanks

Thanks to JetBrains for providing us with <a href="https://www.jetbrains.com/?from=zizibot" target="_blank">dotUltimate</a> licenses.

<a href="https://www.jetbrains.com/?from=zizibot" target="_blank"> <img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" alt="JetBrains logo." width="200"> </a>

Product Compatible and additional computed target framework versions.
.NET 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. 
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
226.7.9677.28345-beta 109 7/1/2026
226.6.9673.26693-beta 103 6/27/2026
226.6.9673.26277-beta 105 6/27/2026
226.6.9673.25181-beta 110 6/27/2026
226.6.9653.27790-beta 102 6/7/2026
226.6.9652.20707-beta 119 6/6/2026
226.6.9651.42537-beta 113 6/5/2026
226.5.9643.29552-beta 107 5/28/2026
226.5.9642.28888-beta 99 5/27/2026
226.5.9641.29477-beta 104 5/26/2026
226.5.9641.27947-beta 100 5/26/2026
226.5.9640.26309-beta 99 5/25/2026
226.5.9629.7382-beta 111 5/14/2026
226.5.9629.6978-beta 101 5/14/2026
226.5.9629.852-beta 104 5/14/2026
226.5.9628.56502 123 5/13/2026
226.5.133.928 102 5/13/2026
226.5.133.926 103 5/13/2026
225.9.9391.28146 360 9/17/2025
1.0.0 113 5/13/2026
Loading failed