Telegram Bots Book
Telegram.Bot is the most popular .NET client for Telegram Bot API, allowing developers to build bots for Telegram messaging app.
This book covers all you need to know to create a chatbot in .NET, with many concrete examples written in C#.
Begin with our Quickstart, or choose from the Table Of Content (left/top), and don't miss our useful Frequently Asked Questions.
🧩 Installation
important
Latest versions of the library are not available on Nuget․org due to false-positive malware detection. We are working with Nuget/ESET teams to resolve this issue.
In the mean time, latest versions are available on our special nuget feed: https://nuget.voids.site/v3/index.json
See the screenshots below to configure the Package source in Visual Studio:
and make sure to follow the Migration Guide for v21.* if you have existing bot code.
Alternatively you can use command line: dotnet nuget add source https://nuget.voids.site/v3/index.json
Or set up a nuget.config
file at the root of your project/solution:
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.voids.site" value="https://nuget.voids.site/v3/index.json" />
</packageSources>
</configuration>
🪄 More examples
This book is filled with ready-to-use snippets of code, but you can also find full project examples at our Telegram.Bot.Examples Github repository, featuring:
- Simple Console apps (long polling)
- Webhook ASP.NET example (with Controllers or Minimal APIs)
- Full-featured advanced solution
- Serverless Functions implementations
🔗 More useful links
Visit our | URL |
---|---|
Nuget feed | https://nuget.voids.site/packages/Telegram.Bot |
Github repo | https://github.com/TelegramBots/Telegram.Bot |
Examples repo | https://github.com/TelegramBots/Telegram.Bot.Examples |
Telegram news channel | https://t.me/tgbots_dotnet |
Telegram support group | https://t.me/joinchat/B35YY0QbLfd034CFnvCtCA |
Team page | https://github.com/orgs/TelegramBots/people |