AKI.TelegramBot.Hosting 1.0.21

dotnet add package AKI.TelegramBot.Hosting --version 1.0.21
NuGet\Install-Package AKI.TelegramBot.Hosting -Version 1.0.21
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="AKI.TelegramBot.Hosting" Version="1.0.21" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AKI.TelegramBot.Hosting --version 1.0.21
#r "nuget: AKI.TelegramBot.Hosting, 1.0.21"
#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.
// Install AKI.TelegramBot.Hosting as a Cake Addin
#addin nuget:?package=AKI.TelegramBot.Hosting&version=1.0.21

// Install AKI.TelegramBot.Hosting as a Cake Tool
#tool nuget:?package=AKI.TelegramBot.Hosting&version=1.0.21

AKI.TelegramBot

This repository contains a Telegram Bot framework implemented in C# using the Telegram.Bot library. The framework provides a convenient and extensible solution for building modular Telegram Bots.

Project Goals

  • Modularity: Build Telegram Bots with modular components, allowing easy customization and extension.

  • Abstraction: Provide an abstraction layer for handling commands, callbacks, and middleware, simplifying bot development.

  • Integration: Seamlessly integrate with the Telegram Bot API for sending and receiving messages, handling updates, and more.

  • Scalability: Design the framework to support high-traffic bots and enable easy deployment to various hosting platforms.

  • Features

  • Command handling: Easily define and handle commands with customizable logic.

  • Callback handling: Handle callback queries from inline keyboards and other interactive elements.

  • Middleware support: Implement custom middleware for request processing and pipeline management.

  • Integration with Telegram Bot API: Interact with the Telegram Bot API for sending messages, managing chats, and more.

Usage Example

class Program
{
    static void Main(string[] args)
    {
        var host = Host.CreateDefaultBuilder(args)
            .ConfigureServices((hostContext, services) =>
            {
                services.AddTelegramBot(config =>
                {
                    config.BotToken = "YOUR_BOT_TOKEN";
                    // Add other configuration options if needed
                })
                .AddMessageHandler<HelpCommandHandler>("/help")
                .SetDefaultMessageHandler<DefaultMessageHandler>();
            })
            .Build();

        host.Run();
    }
}

In this example, we create a new Host using Host.CreateDefaultBuilder and configure the services using the ConfigureServices method. Within the service configuration, we use the AddTelegramBot method to register the Telegram Bot and provide the necessary configuration, such as the bot token. We then register our command handlers using the AddMessageHandler method, specifying the command and the corresponding handler class. Finally, we set the default message handler using the SetDefaultMessageHandler method.

Please note that you need to replace "YOUR_BOT_TOKEN" with your actual bot token obtained from the BotFather on Telegram.

Getting Started

To install the package, you can use the following command in the Nuget Package Manager console:

Install-Package AKI.TelegramBot.Hosting

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue. Pull requests are also appreciated.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for more details.

Acknowledgements

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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
1.0.21 96 3/10/2024
1.0.20 104 3/7/2024
1.0.19 91 2/21/2024
1.0.18 104 2/1/2024
1.0.17 80 1/30/2024
1.0.16 117 1/16/2024
1.0.15 85 1/16/2024
1.0.14 78 1/16/2024
1.0.13 78 1/16/2024
1.0.12 85 1/16/2024
1.0.11 74 1/16/2024
1.0.10 86 1/16/2024
1.0.9 87 1/16/2024
1.0.8 88 1/16/2024
1.0.7 84 1/15/2024
1.0.6 86 1/15/2024
1.0.5 83 1/15/2024
1.0.4 75 1/15/2024
1.0.3 79 1/15/2024
1.0.2 87 1/15/2024
1.0.1 100 1/11/2024
1.0.0 95 1/10/2024