Automated monitoring and notifications for new Telegram gifts and upgrades
- 🎁 New Gifts Detection - Automatically detects and announces new gifts in the Telegram store
- ⬆️ Upgrade Monitoring - Tracks when gifts become upgradeable and price changes
- 💎 Sticker Management - Downloads and uploads gift stickers to a dedicated channel
- 📊 SQLite Database - Stores gift history with async SQLAlchemy ORM
git clone https://github.com/bohd4nx/GiftsTracker.git
cd GiftsTracker
pip install -r requirements.txtCopy example configuration and edit:
cp .env.example .envEdit .env file:
# Telegram API credentials
API_ID=your_api_id
API_HASH=your_api_hash
PHONE_NUMBER=+1234567890
PASSWORD=your_2fa_password
# Bot token
BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
# Channels
CHANNEL_ID=-1001234567890
STICKERS_CHANNEL_ID=-1001234567890
STICKERS_CHANNEL_USERNAME=YourStickersChannel
# Settings
INTERVAL=45-
Get API_ID and API_HASH:
- Visit my.telegram.org/apps
- Login with your phone number
- Create a new application
- Copy API ID → paste to
API_IDin.env - Copy API Hash → paste to
API_HASHin.env
-
Phone Number & 2FA Password:
PHONE_NUMBER: Your Telegram phone number in international format (e.g.,+1234567890)PASSWORD: Your Two-Factor Authentication password (leave empty if not enabled)
- Create New Bot:
- Open Telegram and find @BotFather
- Send
/newbotcommand - Follow instructions to create your bot
- Copy the token → paste to
BOT_TOKENin.env
-
Create Public Channel:
- Create a new Telegram channel for gift notifications
- Make it public (you can make it private later)
- Add your bot as administrator with "Post Messages" permission
-
Get Channel ID:
- Forward any message from channel to @userinfobot
- Copy the Chat ID (format:
-100xxxxxxxxxx) - Paste to
CHANNEL_IDin.env
-
Create Technical Channel:
- Create another channel for storing gift stickers
- Set a unique username (e.g.,
GiftsStickersCache) - Add your bot as administrator
-
Configure in .env:
- Get channel ID same way as notification channel
- Paste ID to
STICKERS_CHANNEL_ID - Paste username (without @) to
STICKERS_CHANNEL_USERNAME
Why separate channels?
- Stickers channel acts as a CDN for gift animations
- Keeps notification channel clean
- Allows link previews with gift animations
INTERVAL - Time in seconds between gift API checks (default: 45)
- Minimum recommended:
30seconds - Adjust based on your needs (lower = faster detection, higher = less API calls)
Start from scratch: The bot will create Gifts.db automatically on first run.
python main.pyExpected output:
[08.02.26 22:20:57] - INFO: Database initialized
[08.02.26 22:20:59] - INFO: Logged in as @your_username [123456789]
[08.02.26 22:20:59] - INFO: Starting gift check cycle #1
[08.02.26 22:21:00] - INFO: Found 0 new gifts to process
When a new gift appears:
- Bot fetches gift data from Telegram API
- Downloads and uploads sticker to technical channel
- Sends formatted notification to main channel
- Saves gift to database
When upgrade becomes available:
- Detects
upgrade_pricefield change fromNoneto value - Sends new notification about upgrade availability
- Stores upgrade message ID for future edits
When upgrade price changes:
- Detects price difference in
upgrade_price - Edits existing upgrade message with new price
- Updates database record
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
This project is provided as-is for educational purposes.