Telegram bot for automated gift purchases. Supports both bot and userbot modes by connecting your own Telegram account session. Features profile configuration and full purchase automation. No commissions. Open source code available for everyone.
- Smart Gift Filtering: Purchase gifts based on customizable filters including minimum/maximum price, supply limits, and purchase quantity.
- Dual Mode Support: Works both as a bot and userbot - connect your own Telegram session for direct account purchases.
- SOCKS5 Proxy Support: Connect SOCKS5 proxies for userbot and aiohttp sessions for enhanced privacy.
- Parallel Gift Checking: Simultaneously checks gift lists from multiple sources (bot + userbot) and selects the best available option.
- Multiple Profiles: Add up to 3 independent profiles with different recipients and limits.
- Real-time Notifications: Get instant notifications for successful purchases and task completions.
- Interactive Menu Control: Manage everything through an intuitive Telegram interface.
- Purchase Tracking: Built-in purchase counter with automatic stopping when limits are reached.
- Purchase Reports: Detailed transaction reports with purchase history and analytics.
- Telegram Stars Integration: Top up and refund through Telegram Stars payment system.
- Multi-account Balance: Allow balance top-ups from any Telegram account.
- Bot Testing: Test bot functionality with a 15-star gift purchase.
- Gift Catalog: Browse complete gift catalog and purchase specific gifts in desired quantities.
- Bulk Refunds: Return all stars from the bot with a single command.
- Redis Integration: Connect to Redis for receiving gift lists from external sources.
Requirements:
- Python 3.10.11 or higher
1. Clone the repository:
git clone https://github.com/devYahia/Area51
cd TelegramGiftsBot2. Install dependencies:
pip install -r requirements.txt3. Create .env file
Create a file named .env in the project root. This file is used to store environment variables.
Example:
TELEGRAM_BOT_TOKEN=123456:abcdefghijklmnopqrstuvwxyz
TELEGRAM_USER_ID=123456789TELEGRAM_BOT_TOKEN— Your Telegram bot token obtained from @BotFatherTELEGRAM_USER_ID— Your Telegram user ID (get it from @userinfobot)
4. Run the bot:
python main.pymain.py— Main script and bot entry pointrequirements.txt— Project dependencies.env— Environment variables file (excluded from git)config.json— User configuration file (excluded from git)handlers/— Event handlers (handlers_main.py, handlers_wizard.py, etc.)middlewares/— Middleware for access control and other update processing aspectsservices/— Business logic and gift manager (balance.py, buy.py, config.py, menu.py, purchase_report.py, etc.)utils/— Utilities and helper scripts (logging.py, misc.py, mockdata.py, proxy.py)
- All handlers are stored in
handlers/- you can add your own scenarios by creating new files. - Main business logic is extracted to
services/- convenient for reuse and testing. utils/contains helper functions that can be extended without risk of breaking core logic.middlewares/contains custom intermediate processors (e.g., access control, logging).- Purchase Reports: New feature in
services/purchase_report.pyprovides detailed transaction tracking and history.
- NEW: Added comprehensive purchase report system with detailed transaction tracking
- NEW: Purchase history viewer with analytics and statistics
- NEW: Real-time purchase notifications with actionable buttons
- Enhanced error handling and logging for purchase operations
- Improved code structure and documentation
- Added ability to select gift list check interval for Userbot
- Added option to enable/disable bot top-ups from other accounts
- Added Redis connection capability for receiving gift lists from external sources
- Improved code and project structure
- Added Telegram session connection capability (userbot)
- Removed ability to request star withdrawals from other accounts
- Bot owner can now refund stars to users by user_id and transaction_id
- Added profile renaming functionality
- Optimized code and improved project structure
- Added profiles for gift purchasing
- Support for bot balance top-ups from any accounts
- Added spam protection
- Improved code and project structure
- Added gift catalog with quantity selection for purchases
- Support for returning all stars with a single command
- Improved project structure
- Added test gift purchase functionality
- First working version: gift purchasing, filter configuration, balance tracking
If you don't want to deal with VPS and environment setup — use ready-made Telegram hosting.
The @GiftsHostingBot allows you to connect this bot for gift purchasing in seconds.
- Get a token from @BotFather (command
/newbot). - Open @GiftsHostingBot and send the command
/addbot. - Enter the token — the bot will be activated on the server.
- No installation and configuration required
- Everything works automatically on the server
- You can connect multiple bots
- Available even without technical knowledge
The hosting may not have the latest version of the bot. This is done to ensure there are no bugs. Updates to the latest version happen automatically after stability verification.
- Token is never stored in plain text.
- You can disable the bot at any time through @BotFather, command
/revoke. - ☎️ Setup and hosting assistance: available on request
- Telegram account: @thesniper051
- Telegram channel: SniperShot
This project is distributed under the MIT License.
