Skip to main content
This guide walks you through building a minimal echo bot from scratch. By the end you will have a working Telegram bot that greets users on /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 PolyBot package targets netstandard2.0 and net10.0)
  • A Telegram bot token from @BotFather

Full example

The listing below is the complete EchoBot Program.cs. The sections that follow break it apart step by step.

Step-by-step walkthrough

Running the bot

Send /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.