Prerequisites
Before installing Telegrator, ensure you have:.NET SDK
- .NET Standard 2.0+ for core package
- .NET 8.0+ for hosting packages
Bot Token
Get your bot token from @BotFather on Telegram
Package Overview
Telegrator consists of three main NuGet packages:Telegrator
Core FrameworkThe main package with handlers, filters, and reactive capabilities
Telegrator.Hosting
.NET Generic HostIntegration with Microsoft.Extensions.Hosting for background services
Telegrator.Hosting.Web
ASP.NET CoreWebhook support and ASP.NET Core integration
Installation
Option 1: Core Package Only
Install the core Telegrator package for basic bot functionality:The core package targets .NET Standard 2.0, making it compatible with .NET Framework 4.6.1+, .NET Core 2.0+, and .NET 5.0+.
Option 2: With Generic Host Support
For production-ready applications with dependency injection, configuration, and logging:Telegrator.Hosting requires .NET 8.0 or later and automatically includes the core Telegrator package.
Option 3: With ASP.NET Core & Webhooks
For web applications that use webhooks instead of long polling:Telegrator.Hosting.Web requires .NET 8.0 or later and includes both Telegrator and Telegrator.Hosting packages.
Dependencies
Each package has the following key dependencies:Telegrator (Core)
- Telegram.Bot (v22.6.2) - Official Telegram Bot API client
- Includes Roslyn-based code generators and analyzers
Telegrator.Hosting
- Microsoft.Extensions.Hosting (v9.0.5) - Generic host implementation
- Microsoft.Extensions.Http (v9.0.5) - HTTP client factory
- Requires all core Telegrator dependencies
Telegrator.Hosting.Web
- Telegram.Bot.AspNetCore (v22.5.0) - ASP.NET Core integration
- Microsoft.AspNetCore.App (framework reference)
- Requires all Telegrator.Hosting dependencies
Verify Installation
After installation, verify that the packages are correctly installed:Next Steps
Now that you have Telegrator installed, you can:Quick Start
Create your first bot in minutes
Core Concepts
Learn about handlers, filters, and the mediator pattern
API Reference
Explore the complete API documentation
Examples
View example projects on GitHub
Troubleshooting
Package version conflicts
Package version conflicts
If you encounter version conflicts with Telegram.Bot or Microsoft.Extensions packages, try:This shows all package versions including transitive dependencies. Update conflicting packages manually in your
.csproj file..NET version compatibility
.NET version compatibility
Ensure your project targets the correct framework:
- Core package: .NET Standard 2.0+
- Hosting packages: .NET 8.0+
TargetFramework in the .csproj file:Analyzer warnings
Analyzer warnings
Telegrator includes Roslyn analyzers that may show warnings. These help ensure correct usage patterns. To disable specific warnings: