🇷 🇺 README in russian available here
This software is designed for automated parsing and purchasing of Telegram gifts. It allows users to configure parameters for tracking and acquiring available gifts based on specified criteria, such as price range and quantity of available gifts.
- Awaiting new gift releases: The software constantly monitors for new gifts.
- Notification: Once a new gift is detected, a notification is sent to a private chat, channel, or group.
- Automated purchase: The software proceeds to purchase the required quantity of the new gift.
- Monitoring: The software compares the list of all available gifts with those in a
.json
file every 8-15 seconds. If a new gift is found (i.e., not present in the.json
file), it proceeds to the next step. - Notification details: An animation of the gift and a message with collection information are sent. The recipient of these messages can be configured by setting the
NOTIFICATIONS_ID
in thedata/config.py
file. - Purchase logic: The software checks if the gift's supply is within the allowed
SUPPLY_LIMIT
range and if its price is within thePRICE_LIMIT
range. If both conditions are met, the bot purchasesGIFT_COUNT_TO_BUY
gifts for the chat ID specified inID_TO_BUY
.
- Python 3.9+
-
Clone the repository
git clone https://github.com/kakashkus/GiftParser_Buyer.git cd GiftParser_Buyer
-
Create a virtual environment
python -m venv venv source venv/bin/activate # Linux/Mac # or venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt
-
Configure
data/config.py
- Open
data/config.py
and fill in yourAPI_ID
,API_HASH
,BOT_TOKEN_WRITER
,NOTIFICATIONS_ID
,ADMIN_ID
, and other auto-purchase settings (BUY_GIFT
,PRICE_LIMIT
,SUPPLY_LIMIT
,GIFT_COUNT_TO_BUY
,ID_TO_BUY
). API_ID
,API_HASH
: Get them from my.telegram.org/auth.BOT_TOKEN_WRITER
: Get this from @BotFather.- For
ADMIN_ID
andNOTIFICATIONS_ID
, you can use @userinfobot to get your chat ID.
- Open
-
Important Note for User Bot Session
- The Telegram bot handles notifications, while a user bot (your Telegram account) performs the actual gift purchases.
- Upon the first run of
main.py
, a user session will be created. You will be prompted to enter your phone number and verification code.
python main.py
Key configuration parameters are located in the data/config.py
file:
API_ID
,API_HASH
: These are essential for Telegram API access. You can obtain them from my.telegram.org/auth.BOT_TOKEN_WRITER
: The Telegram bot token used for sending notifications about new gifts and purchase logs. Obtain this from @BotFather.NOTIFICATIONS_ID
: The chat ID (group/channel/your account ID for direct messages) where the bot will send notifications about new gifts.SEND_NOTIFICATIONS
: Set toTrue
orFalse
to enable or disable notifications mentioned in point 3.ADMIN_ID
: The ID of your main account to which the bot will send gift purchase logs.BUY_GIFT
: Set toTrue
orFalse
to enable or disable automated gift purchases.PRICE_LIMIT
: The allowed price range for a gift.SUPPLY_LIMIT
: The allowed supply range for a gift.GIFT_COUNT_TO_BUY
: The number of gifts the bot should buy from a new collection.ID_TO_BUY
: The chat ID to which the gift should be purchased.
- You can disable gift purchases (
BUY_GIFT = False
) and setNOTIFICATIONS_ID
to a channel ID. This will turn your channel into a simple gift parser, similar to @auto_gifts. - The software can purchase gifts directly for a channel, your own account, or another account.
- If automated purchase is disabled, there's no need to log in to a Telegram account (user bot session).
The Telegram bot searches for and sends notifications about new gifts, while a user bot (Telegram account) handles the actual gift purchase. Therefore, a user session needs to be created. During the first test run, information about a gift will be displayed (if the gift is not new, no purchase will occur).
- Automated Gift Parsing: Tracking new gifts available for purchase in Telegram.
- Flexible Purchase Settings: Setting limits by price, quantity, and other parameters for automated gift acquisition.
- Notifications: Receiving notifications about new gifts or purchase status.