This example demonstrates simple Telegram Bot built with Telegram.Bot.Extensions.Polling library.
Please make sure you have .NET 6 or newer installed. You can download .NET runtime from the official site.
You have to add nuget packages to your project to be able to use polling:
-
Add Telegram.Bot with a package manager in your IDE or from command line:
dotnet add package Telegram.Bot
-
Add Telegram.Bot.Extensions.Polling with a package manager in your IDE or from command line:
dotnet add package Telegram.Bot.Extensions.Polling
Make sure that your .csproj contains these items (versions may vary):
<ItemGroup>
<PackageReference Include="Telegram.Bot" Version="17.0.0" />
<PackageReference Include="Telegram.Bot.Extensions.Polling" Version="1.0.0" />
</ItemGroup>