- Telegrator.Hosting - For console applications and services using .NET Generic Host
- Telegrator.Hosting.Web - For ASP.NET Core applications with webhook support
When to Use Each Package
Telegrator.Hosting
Use this package when building:- Console applications
- Windows Services
- Linux daemons
- Background services
- Applications that receive updates via long polling
- Development and testing
- Bots running on local machines
- Scenarios where you can’t expose a public endpoint
- Simple deployments without webhook configuration
Telegrator.Hosting.Web
Use this package when building:- ASP.NET Core web applications
- Applications deployed to cloud platforms
- Bots that need to handle high update volumes
- Applications that receive updates via webhooks
- Production deployments
- Better scalability and performance
- Lower latency for update delivery
- Integration with existing ASP.NET Core apps
Key Concepts
TelegramBotHost
Both packages provide a host abstraction that:- Integrates with Microsoft.Extensions.Hosting
- Provides dependency injection support
- Manages bot lifetime and update routing
- Configures logging and services
TelegramBotHostBuilder
A builder pattern for configuring your bot:- Configuration - Configure app settings and options
- Logging - Add logging providers
- Services - Register services for dependency injection
- Handlers - Register update handlers
Update Receiving
Long Polling
Continuously polls Telegram servers for updates. Configured automatically in
Telegrator.Hosting.Webhooks
Telegram pushes updates to your endpoint. Configured in
Telegrator.Hosting.Web with ASP.NET Core routing.Installation
Next Steps
Console Applications
Learn how to use Telegrator.Hosting with .NET Generic Host
ASP.NET Core
Learn how to use Telegrator.Hosting.Web with webhooks