Telegram.Bots.Extensions.Polling 2.0.0

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

Telegram.Bots.Extensions.Polling

Integrate Long Polling with Telegram.Bots

Getting Started

Configuring Long Polling with Telegram.Bots
using Microsoft.Extensions.DependencyInjection;
using Telegram.Bots;

...

IServiceCollection services = ...

services.AddBotClient("<bot-token>");
services.AddPolling<UpdateHandler>();
Configuring an Update Handler
using Telegram.Bots.Extensions.Polling;
using Telegram.Bots.Requests;
using Telegram.Bots.Types;

...

public class UpdateHandler : IUpdateHandler
{
  public Task HandleAsync(IBotClient bot, Update update, CancellationToken token)
  {
    return update switch
    {
      MessageUpdate u when u.Data is TextMessage message => EchoText(message),
      EditedMessageUpdate u when u.Data is TextMessage message => EchoTextAsReply(message),
      _ => Task.CompletedTask
    };

    Task EchoText(TextMessage message) =>
      bot.HandleAsync(new SendText(message.Chat.Id, message.Text), token);

    Task EchoTextAsReply(TextMessage message) =>
      bot.HandleAsync(new SendText(message.Chat.Id, message.Text)
      {
        ReplyToMessageId = message.Id
      }, token);
  }
}

License

Telegram.Bots.Extensions.Polling is an extension of Telegram.Bots.
Copyright © 2020-2021 Aman Agnihotri (amanagnihotri@pm.me)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with This program. If not, see GNU Licenses.


Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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.  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 (3)

Showing the top 3 NuGet packages that depend on Telegram.Bots.Extensions.Polling:

Package Downloads
LiraSharpLib

Package Description

LiraSharp

Package Description

UMB.TelegramBot

Una sencilla interfaz para conectar telegram y enviar mensajes, imagenes o archivos

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.9.0 46,994 11/5/2022
5.8.0 1,574 11/3/2022
5.7.0 1,222 11/2/2022
5.6.0 1,556 6/12/2022
5.5.0 1,191 6/8/2022
5.4.0 1,067 6/8/2022
5.3.0 1,103 6/8/2022
5.2.0 1,033 6/8/2022
5.1.0 1,505 9/2/2021
5.0.0 1,743 6/27/2021
4.0.0 1,932 6/26/2021
2.1.0 1,356 3/21/2021
2.0.0 1,509 1/23/2021
1.1.1 1,983 11/6/2020