# PolyBot - [PolyBot: Roslyn-Powered Routing for Telegram.Bot](https://poly-bot.mintlify.app/introduction.md): Learn how PolyBot's source-generator approach turns attribute-decorated handler methods into a hard-coded, DI-friendly BotRouter at compile time. - [PolyBot Quickstart: Build an Echo Bot in Minutes](https://poly-bot.mintlify.app/quickstart.md): Create a working Telegram echo bot with PolyBot — write handlers, register the generated router, and start long polling in a few steps. - [Installing PolyBot: NuGet, Config, and DI Wiring](https://poly-bot.mintlify.app/installation.md): Install the PolyBot NuGet package, configure PolyBotOptions, wire up DI services, and understand project requirements for full routing generation. - [Handlers: Writing and Routing Telegram Updates in PolyBot](https://poly-bot.mintlify.app/concepts/handlers.md): Learn how PolyBot handler methods work, how the source generator builds a typed router, and how priority and fall-through routing control execution order. - [Parameter Injection: How Handler Arguments Are Resolved](https://poly-bot.mintlify.app/concepts/parameter-injection.md): Understand PolyBot's parameter resolution order — bot client, cancellation token, typed update payloads, keyed services, and plain DI services. - [Routing Result: Controlling the PolyBot Handler Chain](https://poly-bot.mintlify.app/concepts/routing-result.md): Explore the Result struct that every PolyBot handler returns, and learn how ContinueRouting, StopRouting, and Handled() control multi-handler dispatch. - [Update Filters: Gating Handlers with Custom Logic](https://poly-bot.mintlify.app/concepts/filters.md): How IUpdateFilter implementations become generated attributes, how stacked filters use AND semantics, and how PolyBot resolves filter instances from DI. - [Inline Awaiting: Conversational Flows as Plain Code](https://poly-bot.mintlify.app/concepts/inline-awaiting.md): Model multi-step bot conversations as ordinary linear code: suspend a handler on an await, then parse the user's reply with the bundled command-args and callback-pattern helpers. - [Bot Commands: Routing, Arguments & BotFather Sync in PolyBot](https://poly-bot.mintlify.app/features/commands.md): Define slash commands with typed argument extraction, optional parameters, and automatic BotFather menu synchronization using the [Command] attribute. - [Finite State Machines: Per-User Conversation Flows](https://poly-bot.mintlify.app/features/state-machines.md): Gate handlers on per-user enum states, drive transitions via IStateMachine, compose OR/AND predicates across enums, and register a custom IStateStorage. - [Keyboards: Fluent Builders and Source-Generated Layouts](https://poly-bot.mintlify.app/features/keyboards.md): Build keyboards with fluent builders or declare layouts via [CallbackButton] on partial methods — the source generator emits the markup body for you. - [Callback-Data Patterns: Typed Route Templates for Callbacks](https://poly-bot.mintlify.app/features/callback-patterns.md): Declare route templates over CallbackQuery.Data with [Pattern]: match literal segments, extract typed captures via TryParse, and catch wildcard tails. - [Inline Awaits: Suspending Handlers Mid-Conversation](https://poly-bot.mintlify.app/features/inline-awaits.md): Pause a handler and resume it on a later matching update — regex filters, static predicates, and optional timeouts keep the polling loop fully unblocked. - [Rate Limiting: Sliding-Window Throttles per Handler](https://poly-bot.mintlify.app/features/rate-limiting.md): Attach sliding-window throttles to any handler with [Throttled], keyed by user, chat, or globally — halt or skip the routing branch on limit exceeded. - [Allowed Updates: Compile-Time Inference & Overrides in PolyBot](https://poly-bot.mintlify.app/features/allowed-updates.md): Automatically infer Telegram allowed update types from handler signatures and conversation await sites, or customize them using the [AllowedUpdates] assembly attribute. - [Rich Messages: Block Layout, Inline Formatting & Media in PolyBot](https://poly-bot.mintlify.app/features/rich-messages.md): Compose structured Telegram rich messages with paragraphs, headings, tables, quotations, and rich inline text using the fluent RichMessageBuilder. - [Exception Handling: Centralised Bot Error Reporting](https://poly-bot.mintlify.app/features/exception-handling.md): Centralise bot error handling with one [ExceptionHandler] method: receive the exception and source, inject DI services, and keep the polling loop alive. - [PolyBotClient Standalone Polling: No IHost Required](https://poly-bot.mintlify.app/hosting/polling.md): Run a PolyBot bot without IHost or ASP.NET Core: PolyBotClient manages the service collection, configuration, BotFather sync, and long polling. - [Generic Host Integration with AddPolyBotHostedPolling](https://poly-bot.mintlify.app/hosting/generic-host.md): Host a PolyBot bot inside a .NET generic host: AddPolyBotHostedPolling registers the generated router and IHostedService polling lifecycle. - [PolyBot Webhook Setup with ASP.NET Core Minimal API](https://poly-bot.mintlify.app/hosting/webhooks.md): Receive Telegram updates via HTTPS with AddPolyBotWebhook and MapPolyBotWebhook: secret-token verification, deserialization, lifecycle management. - [Test PolyBot Handlers with RunTest and UpdateMocker](https://poly-bot.mintlify.app/testing/test-harness.md): Test PolyBot handlers offline with RunTest and UpdateMocker: push synthetic messages, commands, callbacks, and inline queries, then assert sent requests. - [PolyTests: Offline ITelegramBotClient for PolyBot Tests](https://poly-bot.mintlify.app/testing/poly-tests.md): PolyTests is PolyBot's offline ITelegramBotClient double: enqueue synthetic updates with long-poll semantics and assert outgoing requests, no token needed. - [PolyBotOptions: Complete Bot Configuration Reference](https://poly-bot.mintlify.app/reference/polybotoptions.md): Complete reference for all PolyBotOptions properties — bot identity, client settings, polling, and webhook configuration — with defaults and examples. - [PolyBot Attributes: Full Routing Attribute Reference](https://poly-bot.mintlify.app/reference/attributes.md): Every PolyBot attribute explained — handler markers, routing guards, parameter binding, rate limiting, keyboard generation, and exception handling. - [PolyBot Interfaces, Implementations, and DI Defaults](https://poly-bot.mintlify.app/reference/interfaces.md): Reference for PolyBot interfaces — IUpdateFilter, IStateMachine, IStateStorage, IUpdateAwaiter, IBotFatherSync — with implementations and DI defaults. - [UpdateExtensions: Telegram Update Payload Probe Methods](https://poly-bot.mintlify.app/reference/update-extensions.md): Reference for UpdateExtensions — first-match probes that extract user ids, chat ids, senders, chats, messages, and text from any Telegram Update. - [PolyBot Compiler Diagnostics: CUR001–CUR056 Guide](https://poly-bot.mintlify.app/reference/diagnostics.md): Complete reference for every PolyBot source-generator diagnostic (CUR001–CUR056) — severity, trigger condition, and fix, grouped by feature area. - [PolyBot Roslyn Source Generator Internals and Design](https://poly-bot.mintlify.app/advanced/source-generator.md): Inside the PolyBot incremental source generator: discovery phases, emitter classes, generated files for executables vs libraries, and InternalsGenerators. - [PolyBot Library vs Executable: OutputType Explained](https://poly-bot.mintlify.app/advanced/library-vs-executable.md): How OutputType controls what PolyBot generates, when to use filter libraries, cross-assembly filter usage, and a full example with a shared filter library. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.