/start and echoes every other message back. The complete source is based on the EchoBot sample shipped with PolyBot.
Before you start, make sure you have the
PolyBot NuGet package installed and that your project’s OutputType is Exe. See Installation for details.Prerequisites
- .NET 8 or later (the
PolyBotpackage targetsnetstandard2.0andnet10.0) - A Telegram bot token from @BotFather
Full example
The listing below is the complete EchoBotProgram.cs. The sections that follow break it apart step by step.
Step-by-step walkthrough
Running the bot
/start to your bot in Telegram — it should reply with the welcome message. Any other text message will be echoed back.
What to explore next
Installation
NuGet setup, project requirements,
PolyBotOptions reference, and service wiring details.Introduction
Full feature overview: FSM, filters, rate limiting, webhooks, and more.