Max.Bot.SDK 0.2.3

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

The Bot API is an HTTP-based interface created for developers keen on building bots for MAX.

🚀 Need help integrating MAX bots or building production-ready solutions?

I can help you with: ⚡ Custom bot development ⚡ Webhook setup & scaling ⚡ Architecture & performance optimization

📩 Contact: nazarko.danny@gmail.com 💬 Telegram: https://t.me/DanilSPY 💬 Max: Назарько Данил

Check 👉How to create bot👈

Check 👉 setting up the bot 👈

Check 👉 Bots: An introduction for developers 👈 to understand what a Telegram bot is and what it can do.

🚧 Supported Platforms 🚧

.NET 8 .NET 9 .NET 10

⭐ Quick start ⭐

Bot token is a key that required to authorize the bot and send requests to the Bot API. Keep your token secure and store it safely, it can be used to control your bot. It should look like this:

k7L9clfI4zjGIK8jgWS2ieFffQcgXRhK-K20I_q5v8wgot3HheQUSoqjX1ln7V371MVDYwdXdJWlICxytQ1XR

Now that you have a bot, it’s time to bring it to life!

dotnet add package Max.Bot

Webhooks

With Webhook, your web application gets notified one by one, automatically by MAX.api when new updates arrive for your bot.

Here are example codes for handling updates, depending on the types of ASP.NET projects:

ASP.NET Core with Controllers (MVC)

🧩 Quickstart (Dependency Injection)

🌐 Webhook Setup & Debugging (HTTPS Required)

MAX Bot API works exclusively over HTTPS, therefore a secure public URL is required when using webhooks. For local development and debugging, we strongly recommend using ngrok.


🔧 Why ngrok?

When running your application locally:

  • your server is available only on http://localhost
  • MAX Bot API cannot send webhooks to non-HTTPS endpoints

ngrok creates a secure HTTPS tunnel to your local server and exposes it to the internet.


📥 Step 1: Install ngrok

Download ngrok from the official website:

👉 https://ngrok.com/download

🚀 Step 2: Start NGROK Start HTTPS Tunnel

ngrok http (your applicationUrl port)

🚀 Step 3: Configure Webhook URL

Use the generated HTTPS URL as your webhook endpoint:

Forwarding       https://61a6-77-73-123-123.ngrok-free.app -> http://localhost:1234  

🚀 Step 4: Change config in appsettings.json

{
  "BotConfiguration": {
    "Token": "YOUR_MAX_BOT_TOKEN",
    "BaseUrl": "https://61a6-77-73-232-178.ngrok-free.app/(Your endpoint name 'Bot')"
  }
}

🚀 Step 5: Dependency Injection in program.cs or Startup.cs

@using MAX.Bot.Services;

var builder = WebApplication.CreateBuilder(args);

var botConfigSection = builder.Configuration.GetSection("BotConfiguration");
builder.Services.Configure<BotConfiguration>(botConfigSection);
builder.Services.AddMaxBot(builder.Configuration);

var app = builder.Build();

🚀 Step 6: Using Max.Bot in Your Own Services

Max.Bot is designed to be easily integrated into your own application services.

You can implement custom update processing logic by creating your own IUpdateHandler.

Custom Update Handler

public class UpdateHandler : IUpdateHandler
{
    private readonly IMaxBotClient _bot;
    private readonly ILogger<UpdateHandler> _logger;

    public UpdateHandler(
        IMaxBotClient bot,
        ILogger<UpdateHandler> logger)
    {
        _bot = bot;
        _logger = logger;
    }

    public async Task HandleAsync(Update update, CancellationToken ct)
    {
        _logger.LogInformation("Received update: {UpdateId}", update.UpdateId);

        if (update.Message != null)
        {
            await _bot.SendMessageAsync(
                update.Message.ChatId,
                "Hello from Max.Bot 👋",
                ct);
        }
    }
}

Register Custom Handler builder.Services.AddScoped<IUpdateHandler, UpdateHandler>();

🚀 Step 7: Handling Updates (Controller Example)

(Controller Example)

[HttpPost]
public async Task HandleUpdate([FromBody] Update update)
{
    // put your code to handle one Update here.
}

Or using Dependency Injection:

 [HttpPost]
 public async Task<IActionResult> Post([FromBody] Update update, [FromServices] IMaxBotClient bot, [FromServices] IUpdateHandler handler, CancellationToken ct)
 {
    // put your code to handle one Update here.
    await handler.HandleAsync(update, ct);
    return Ok();
 }

This approach provides:

✅ clean separation of concerns ✅ full DI support ✅ easy unit testing ✅ native ASP.NET Core experience


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 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. 
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
0.2.3 97 5/15/2026
0.2.2 139 3/30/2026
0.2.1 103 3/30/2026
0.2.0 112 3/27/2026
0.1.9 106 3/26/2026
0.1.8 99 3/25/2026
0.1.7 101 3/25/2026
0.1.6 103 3/24/2026
0.1.5 119 3/18/2026
0.1.3 114 2/20/2026
0.1.2 102 2/20/2026
0.1.1 111 2/10/2026