AKI.TelegramBot.Hosting 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package AKI.TelegramBot.Hosting --version 1.0.1                
NuGet\Install-Package AKI.TelegramBot.Hosting -Version 1.0.1                
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.1" />                
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.1                
#r "nuget: AKI.TelegramBot.Hosting, 1.0.1"                
#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.1

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

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 net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 138 3/10/2024
1.0.20 120 3/7/2024
1.0.19 114 2/21/2024
1.0.18 125 2/1/2024
1.0.17 100 1/30/2024
1.0.16 136 1/16/2024
1.0.15 103 1/16/2024
1.0.14 98 1/16/2024
1.0.13 105 1/16/2024
1.0.12 111 1/16/2024
1.0.11 95 1/16/2024
1.0.10 104 1/16/2024
1.0.9 113 1/16/2024
1.0.8 111 1/16/2024
1.0.7 108 1/15/2024
1.0.6 108 1/15/2024
1.0.5 102 1/15/2024
1.0.4 96 1/15/2024
1.0.3 100 1/15/2024
1.0.2 104 1/15/2024
1.0.1 117 1/11/2024
1.0.0 111 1/10/2024