Features
- 🚀 Easy Integration - Works with aiogram, python-telegram-bot, and pyTelegramBotAPI
- 📊 Event Tracking - Track messages, callback queries, and all Telegram update types
- 🔄 Framework Agnostic - Automatically detects your bot framework
- ⚡ Async Support - Full async/await support with automatic sync wrapper
- 🛡️ Error Handling - Robust error handling with configurable exception suppression
- 🎯 Invitation Tracking - Track user invitations and referrals
Supported Frameworks
- aiogram (v3.x)
- python-telegram-bot (v21.x)
- pyTelegramBotAPI (v4.x)
Installation
Quick Start
Basic Usage
event_data
parameter should contain the update data in raw Telegram API format, or the corresponding update/message object from your framework (aiogram, python-telegram-bot, or pyTelegramBotAPI).
Framework Integration
aiogram
Choose the integration method that best fits your needs:python-telegram-bot (v21.x)
pyTelegramBotAPI
API Reference
Dashgram Class
Constructor
project_id
- Your Dashgram project ID (found in your project settings)access_key
- Your Dashgram access key (found in your project settings)api_url
- Custom API URL (defaults tohttps://api.dashgram.io/v1
)origin
- Custom origin string for SDK usage analytics (optional)
Methods
track_event()
event
- Telegram event object or dictionary (from any supported framework)handler_type
- Type of handler (optional if event is a framework object)suppress_exceptions
- Whether to suppress exceptions (default: True)
bool
- True if successful, False otherwise
invited_by()
user_id
- ID of the invited userinvited_by
- ID of the user who sent the invitationsuppress_exceptions
- Whether to suppress exceptions (default: True)
bool
- True if successful, False otherwise